diff --git a/resources/assets/src/views/user/Players/index.tsx b/resources/assets/src/views/user/Players/index.tsx index eaf720a7..ea9d7ea0 100644 --- a/resources/assets/src/views/user/Players/index.tsx +++ b/resources/assets/src/views/user/Players/index.tsx @@ -129,7 +129,7 @@ const Players: React.FC = () => { return } - const { code, message } = await fetch.post( + const { code, message } = await fetch.post( `/user/player/delete/${player.pid}`, ) if (code === 0) { diff --git a/resources/assets/tests/ts-shims/net.ts b/resources/assets/tests/ts-shims/net.ts index 1286bbb6..a62dc37f 100644 --- a/resources/assets/tests/ts-shims/net.ts +++ b/resources/assets/tests/ts-shims/net.ts @@ -1,6 +1,8 @@ /* eslint-disable @typescript-eslint/indent */ import * as net from '../../src/scripts/net' +export { ResponseBody } from '../../src/scripts/net' + export const init = {} as typeof net.init export const walkFetch = {} as jest.Mock< @@ -8,22 +10,28 @@ export const walkFetch = {} as jest.Mock< Parameters > +type FetchFn = (url: string, data?: object) => Promise + export const get = {} as jest.Mock< ReturnType, Parameters -> +> & + FetchFn export const post = {} as jest.Mock< ReturnType, Parameters -> +> & + FetchFn export const put = {} as jest.Mock< ReturnType, Parameters -> +> & + FetchFn export const del = {} as jest.Mock< ReturnType, Parameters -> +> & + FetchFn