aboutsummaryrefslogtreecommitdiffstats
path: root/code/app/src/lib/api
diff options
context:
space:
mode:
Diffstat (limited to 'code/app/src/lib/api')
-rw-r--r--code/app/src/lib/api/_fetch.ts20
-rw-r--r--code/app/src/lib/api/account/models/LoginPayload.ts5
-rw-r--r--code/app/src/lib/api/account/models/UpdateProfilePayload.ts4
3 files changed, 10 insertions, 19 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;
}
diff --git a/code/app/src/lib/api/account/models/LoginPayload.ts b/code/app/src/lib/api/account/models/LoginPayload.ts
deleted file mode 100644
index beb96cf..0000000
--- a/code/app/src/lib/api/account/models/LoginPayload.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export interface LoginPayload {
- username: string,
- password: string,
- persist: boolean
-}
diff --git a/code/app/src/lib/api/account/models/UpdateProfilePayload.ts b/code/app/src/lib/api/account/models/UpdateProfilePayload.ts
deleted file mode 100644
index d2983ff..0000000
--- a/code/app/src/lib/api/account/models/UpdateProfilePayload.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export interface UpdateProfilePayload {
- username?: string,
- password?: string,
-}