diff --git a/packages/frontend/src/scripts/api.ts b/packages/frontend/src/scripts/api.ts index 55431679dc..0f54f779a6 100644 --- a/packages/frontend/src/scripts/api.ts +++ b/packages/frontend/src/scripts/api.ts @@ -56,7 +56,12 @@ export function api(hostUrl: string, endpoint: E, data: P = {} as any, token?: string | null | undefined, signal?: AbortSignal): Promise { +export function apiExternal( + hostUrl: string, + endpoint: E, data: P = {} as any, + token?: string | null | undefined, + signal?: AbortSignal, +): Promise> { if (!/^https?:\/\//.test(hostUrl)) throw new Error('invalid host name'); if (endpoint.includes('://')) throw new Error('invalid endpoint'); pendingApiRequestsCount.value++; @@ -100,7 +105,10 @@ export function apiExternal(endpoint: E, data: P = {} as any): Promise { +export function apiGet( + endpoint: E, + data: P = {} as any, +): Promise> { pendingApiRequestsCount.value++; const onFinally = () => {