aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/utils')
-rw-r--r--src/api/utils/auth.ts (renamed from src/api/utils/auth.js)8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/api/utils/auth.js b/src/api/utils/auth.ts
index 07b0c096b..98295d1a4 100644
--- a/src/api/utils/auth.js
+++ b/src/api/utils/auth.ts
@@ -15,6 +15,7 @@ export const prepareAuthRequest = (
15 'X-Franz-platform': process.platform, 15 'X-Franz-platform': process.platform,
16 'X-Franz-Timezone-Offset': new Date().getTimezoneOffset(), 16 'X-Franz-Timezone-Offset': new Date().getTimezoneOffset(),
17 'X-Franz-System-Locale': ferdiLocale, 17 'X-Franz-System-Locale': ferdiLocale,
18 // @ts-expect-error Property 'headers' does not exist on type '{ method: string; }'.
18 ...options.headers, 19 ...options.headers,
19 }, 20 },
20 }); 21 });
@@ -28,5 +29,10 @@ export const prepareAuthRequest = (
28 return request; 29 return request;
29}; 30};
30 31
31export const sendAuthRequest = (url, options, auth) => 32export const sendAuthRequest = (
33 url: RequestInfo,
34 options: { method: string } | undefined,
35 auth?: boolean,
36) =>
37 // @ts-expect-error Argument of type '{ method: string; } & { mode: string; headers: any; }' is not assignable to parameter of type 'RequestInit | undefined'.
32 window.fetch(url, prepareAuthRequest(options, auth)); 38 window.fetch(url, prepareAuthRequest(options, auth));