Skip to content

Commit 55b2b56

Browse files
committed
fix: typing
1 parent 43c318b commit 55b2b56

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

server/util/jami.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import axios from 'axios'
22
import * as Sentry from '@sentry/node'
33
import { JAMI_URL, API_TOKEN, inProduction } from './common.js'
4-
import { access } from 'fs'
5-
import { KeyboardDoubleArrowLeftRounded } from '@mui/icons-material'
64
import { ProgrammeLevel } from '@/shared/lib/enums.js'
5+
import logger from './logger.js'
76

87
interface Faculty {
98
readonly code: string
@@ -91,7 +90,7 @@ export const getIamAccess = async (iamGroups: string[], attempt = 1): Promise<Ac
9190
return { specialGroup, access: { ...lomakeAccess, ...access } }
9291
} catch (error: any) {
9392
if (attempt > 3) {
94-
console.log('[Jami] error: ', error)
93+
logger.error('[Jami] error: ', error)
9594
Sentry.captureException(error)
9695

9796
return {}
@@ -107,19 +106,19 @@ export const getOrganisationData = async (): Promise<Faculty[]> => {
107106
return data
108107
}
109108

110-
export const getJoryMapFromJami = async () => {
109+
export const getJoryMapFromJami = async (): Promise<Record<string, string | string[]>> => {
111110
const { data } = await jamiClient.get('/jory-map')
112111
return data
113112
}
114113

115114
export const testJami = async () => {
116115
try {
117116
await jamiClient.get('/ping', { timeout: 4000 })
118-
console.log('JAMI connected')
117+
logger.info('JAMI connected')
119118
} catch (error) {
120-
console.log(error)
121-
console.log(JAMI_URL)
122-
console.log('JAMI not responding :(')
123-
console.log('Are you sure you are using the latest JAMI image?')
119+
logger.error(error)
120+
logger.error(JAMI_URL)
121+
logger.error('JAMI not responding :(')
122+
logger.error('Are you sure you are using the latest JAMI image?')
124123
}
125124
}

0 commit comments

Comments
 (0)