aboutsummaryrefslogtreecommitdiffstats
path: root/code/app
diff options
context:
space:
mode:
Diffstat (limited to 'code/app')
-rwxr-xr-xcode/app/bun.lockbbin119706 -> 232153 bytes
-rw-r--r--code/app/package.json17
-rw-r--r--code/app/src/utilities/_fetch.ts23
3 files changed, 13 insertions, 27 deletions
diff --git a/code/app/bun.lockb b/code/app/bun.lockb
index 2b9eee0..450c49f 100755
--- a/code/app/bun.lockb
+++ b/code/app/bun.lockb
Binary files differ
diff --git a/code/app/package.json b/code/app/package.json
index 53945f3..bd64dba 100644
--- a/code/app/package.json
+++ b/code/app/package.json
@@ -15,15 +15,9 @@
},
"devDependencies": {
"@faker-js/faker": "^7.6.0",
- "@playwright/test": "^1.31.1",
- "@sveltejs/adapter-node": "1.2.0",
"@sveltejs/kit": "1.9.2",
"@tailwindcss/forms": "^0.5.3",
- "@types/js-cookie": "^3.0.3",
- "@vite-pwa/sveltekit": "^0.1.3",
- "autoprefixer": "^10.4.13",
"npm-run-all": "^4.1.5",
- "pino-pretty": "^9.4.0",
"postcss": "^8.4.21",
"postcss-load-config": "^4.0.1",
"svelte": "^3.55.1",
@@ -37,14 +31,7 @@
"vite-plugin-pwa": "^0.14.4"
},
"dependencies": {
- "@developermuch/dev-svelte-headlessui": "0.0.1",
- "@rgossiaux/svelte-headlessui": "^1.0.2",
- "fuzzysort": "^2.0.4",
- "js-cookie": "^3.0.1",
- "pino": "^8.11.0",
- "pino-seq": "^0.9.0",
"svelte-headless-table": "^0.17.2",
- "temporal-polyfill": "^0.1.1",
- "turbo-query": "^1.9.0"
+ "temporal-polyfill": "^0.1.1"
}
-} \ No newline at end of file
+}
diff --git a/code/app/src/utilities/_fetch.ts b/code/app/src/utilities/_fetch.ts
index 415e1c2..f884653 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 {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<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;
}
@@ -42,11 +42,10 @@ async function internal_fetch_async(request: InternalFetchRequest): Promise<Resp
response = await fetch(fetch_request);
}
} catch (error: any) {
- console.error(error);
if (error.message === "Timeout") {
- console.error("Request timed out");
+ console.error("Request timed out", error);
} else if (error.message === "Network request failed") {
- console.error("No internet connection");
+ console.error("No internet connection", error);
} else {
throw error;
}