aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/utils
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-10-02 09:24:32 +0200
committerLibravatar GitHub <noreply@github.com>2021-10-02 09:24:32 +0200
commitbfe8847d72cd0893230f2e654242658214943e61 (patch)
tree3384b02ebad7a74cbb106ddd95546e0e24ff0bb8 /src/api/utils
parentfix: Fix navigation shortcut accelerator for non-macos (fixes #1172) (#2012) (diff)
downloadferdium-app-bfe8847d72cd0893230f2e654242658214943e61.tar.gz
ferdium-app-bfe8847d72cd0893230f2e654242658214943e61.tar.zst
ferdium-app-bfe8847d72cd0893230f2e654242658214943e61.zip
chore: convert various files from JS to TS (#2010)
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));