aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-02-24 08:17:43 -0800
committerAdam Soltys <[email protected]>2024-02-24 08:17:43 -0800
commit094fac4466805b253a6cc9946c9fe716b749b428 (patch)
tree50dd6b432aa9f3f24bfb93089b1422349238bce8 /src/lib
parent20907508a3703a8793265e13151b8daad6b4106e (diff)
downloadcoinos-ui-094fac4466805b253a6cc9946c9fe716b749b428.tar.gz
coinos-ui-094fac4466805b253a6cc9946c9fe716b749b428.zip
remove timeout
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/utils.js11
1 files changed, 2 insertions, 9 deletions
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;
};