From cf546fd4b9a1fbf77bccf5f0b713e688d29a66ad Mon Sep 17 00:00:00 2001 From: iv-ar Date: Sat, 4 Mar 2023 16:54:16 +0100 Subject: feat: Use console to log --- code/app/src/utilities/_fetch.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'code/app/src/utilities/_fetch.ts') diff --git a/code/app/src/utilities/_fetch.ts b/code/app/src/utilities/_fetch.ts index 992c7f5..415e1c2 100644 --- a/code/app/src/utilities/_fetch.ts +++ b/code/app/src/utilities/_fetch.ts @@ -1,28 +1,28 @@ -import { Temporal } from "temporal-polyfill"; -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 "$utilities/logger"; -import { AccountService } from "$services/account-service"; +import {Temporal} from "temporal-polyfill"; +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 {AccountService} from "$services/account-service"; + export async function http_post_async(url: string, body?: object | string, timeout = -1, skip_401_check = false, abort_signal?: AbortSignal): Promise { 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 { 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 { 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; } @@ -42,7 +42,7 @@ async function internal_fetch_async(request: InternalFetchRequest): Promise