Skip to content

Commit b5277af

Browse files
committed
fix: some type checking
Signed-off-by: jamshale <jamiehalebc@gmail.com>
1 parent 90ee1af commit b5277af

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

frontend/src/client/api/BaseUrl.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { create } from 'axios'
1+
import type { AxiosResponse, AxiosError, InternalAxiosRequestConfig } from 'axios'
2+
3+
import axios from 'axios'
24

35
import log from '../utils/logger'
46

@@ -7,19 +9,20 @@ export const baseUrl = (import.meta.env.VITE_HOST_BACKEND || '') + baseRoute
79
export const baseWsUrl = import.meta.env.VITE_HOST_BACKEND || ''
810
export const socketPath = `${baseRoute}/demo/socket/`
911

10-
export const apiCall = create({ baseURL: baseUrl })
12+
// eslint-disable-next-line import/no-named-as-default-member
13+
export const apiCall = axios.create({ baseURL: baseUrl })
1114

12-
apiCall.interceptors.request.use((config) => {
15+
apiCall.interceptors.request.use((config: InternalAxiosRequestConfig) => {
1316
log.debug(`[API] ${config.method?.toUpperCase()} ${config.url}`, config.params ?? '')
1417
return config
1518
})
1619

1720
apiCall.interceptors.response.use(
18-
(response) => {
21+
(response: AxiosResponse) => {
1922
log.debug(`[API] ${response.status} ${response.config.method?.toUpperCase()} ${response.config.url}`)
2023
return response
2124
},
22-
(error) => {
25+
(error: AxiosError) => {
2326
log.warn(
2427
`[API] error ${error.response?.status ?? 'unknown'} ${error.config?.method?.toUpperCase()} ${error.config?.url}`,
2528
error.message,

frontend/src/client/pages/dashboard/components/RevocationContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const RevocationContainer: React.FC<Props> = ({ revocationRecord, revocat
3939
loadingList.push(item.revocationRegId)
4040
setLoadingRevocations(loadingList)
4141

42-
revokeCredential(item).then((result) => {
42+
revokeCredential(item).then((result: any) => {
4343
if (result.status === 200) {
4444
revocations.push(item.revocationRegId)
4545
setCompletedRevocations(revocations)

0 commit comments

Comments
 (0)