From 2395451b1803fc45cf28d0469c16d702531b5396 Mon Sep 17 00:00:00 2001 From: flx-sta <50131232+flx-sta@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:43:40 -0700 Subject: [PATCH] remove Utils.apiPost --- src/utils.ts | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index feee203882c..9014519b7a9 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -331,24 +331,6 @@ export async function localPing() { } } -export function apiPost(path: string, data?: any, contentType: string = "application/json", authed: boolean = false): Promise { - return (isLocal && isLocalServerConnected) || !isLocal ? new Promise((resolve, reject) => { - const headers = { - "Accept": contentType, - "Content-Type": contentType, - }; - if (authed) { - const sId = getCookie(sessionIdKey); - if (sId) { - headers["Authorization"] = sId; - } - } - fetch(`${apiUrl}/${path}`, { method: "POST", headers: headers, body: data }) - .then(response => resolve(response)) - .catch(err => reject(err)); - }) : new Promise(() => {}); -} - /** Alias for the constructor of a class */ export type Constructor = new(...args: unknown[]) => T;