diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-11-17 07:48:00 +0100 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-11-17 07:48:00 +0100 |
| commit | 6ea5bd8c6ec089c278253d251f83c59ca5338dea (patch) | |
| tree | e74af816f5bde4cb398915c7b656ec36385b72bd /code/app/src/lib/api/_fetch.ts | |
| parent | 971a70d15e5531b59afd74556dc50214deeeafe9 (diff) | |
| download | greatoffice-6ea5bd8c6ec089c278253d251f83c59ca5338dea.tar.xz greatoffice-6ea5bd8c6ec089c278253d251f83c59ca5338dea.zip | |
refactor: Small changes
Diffstat (limited to 'code/app/src/lib/api/_fetch.ts')
| -rw-r--r-- | code/app/src/lib/api/_fetch.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/code/app/src/lib/api/_fetch.ts b/code/app/src/lib/api/_fetch.ts index 62cdf84..21df208 100644 --- a/code/app/src/lib/api/_fetch.ts +++ b/code/app/src/lib/api/_fetch.ts @@ -1,28 +1,28 @@ -import {Temporal} from "temporal-polyfill"; -import {clear_session_data} from "$lib/session"; -import {redirect} from "@sveltejs/kit"; -import {browser} from "$app/environment"; -import {goto} from "$app/navigation"; -import {SignInPageMessage, signInPageMessageQueryKey} from "$routes/(main)/(public)/sign-in"; -import {log_error} from "$lib/logger"; +import { Temporal } from "temporal-polyfill"; +import { clear_session_data } from "$lib/session"; +import { redirect } from "@sveltejs/kit"; +import { browser } from "$app/environment"; +import { goto } from "$app/navigation"; +import { SignInPageMessage, signInPageMessageQueryKey } from "$routes/(main)/(public)/sign-in"; +import { log_error } from "$lib/logger"; export async function http_post_async(url: string, body?: object | string, timeout = -1, skip_401_check = false, abort_signal?: AbortSignal): Promise<Response> { const init = make_request_init("post", body, abort_signal); - const response = await internal_fetch_async({url, init, timeout}); + const response = await internal_fetch_async({ url, init, timeout }); if (!skip_401_check && await redirect_if_401_async(response)) throw new Error("Server returned 401"); return response; } export async function http_get_async(url: string, timeout = -1, skip_401_check = false, abort_signal?: AbortSignal): Promise<Response> { const init = make_request_init("get", undefined, abort_signal); - const response = await internal_fetch_async({url, init, timeout}); + const response = await internal_fetch_async({ url, init, timeout }); if (!skip_401_check && await redirect_if_401_async(response)) throw new Error("Server returned 401"); return response; } export async function http_delete_async(url: string, body?: object | string, timeout = -1, skip_401_check = false, abort_signal?: AbortSignal): Promise<Response> { const init = make_request_init("delete", body, abort_signal); - const response = await internal_fetch_async({url, init, timeout}); + const response = await internal_fetch_async({ url, init, timeout }); if (!skip_401_check && await redirect_if_401_async(response)) throw new Error("Server returned 401"); return response; } |
