From 094fac4466805b253a6cc9946c9fe716b749b428 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 24 Feb 2024 08:17:43 -0800 Subject: remove timeout --- src/lib/utils.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/lib/utils.js b/src/lib/utils.js index 0b76365c..6902c928 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -41,23 +41,17 @@ export let get = (url, headers = {}) => { }); }; -export let post = async (url, body, headers, timeout = 8000) => { - headers = { +export let post = async (url, body, headers) => { + headers = { "content-type": "application/json", accept: "application/json", ...headers, }; - let controller = new AbortController(); - let id = setTimeout(() => { - controller.abort(new Error("Operation timed out")); - }, timeout); - let response = await fetch(base + url, { method: "POST", body: JSON.stringify(body), headers, - signal: controller.signal, }) .then(async (r) => { if (r.ok) return r.text(); @@ -85,7 +79,6 @@ export let post = async (url, body, headers, timeout = 8000) => { return body; }); - clearTimeout(id); return response; }; -- cgit v1.2.3