From e0616f3ddd0cc006fa2a2f4493e623a4b86f276f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 5 Sep 2022 11:23:59 -0700 Subject: add origin env var --- src/lib/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/utils.js') diff --git a/src/lib/utils.js b/src/lib/utils.js index 401613b8..ecf93062 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -8,7 +8,7 @@ export function scroll(section) { const base = browser ? '' : import.meta.env.VITE_COINOS_URL; -export const get = (url, headers = { accept: 'application/json' }) => +export const get = (url, headers = {}) => fetch(base + url, { headers }) .then((r) => r.text()) .then((body) => { @@ -20,7 +20,7 @@ export const get = (url, headers = { accept: 'application/json' }) => }); export const post = (url, body, headers) => { - headers = { ...headers, accept: 'application/json', 'content-type': 'application/json' }; + headers = { ...headers, 'content-type': 'application/json' }; return fetch(base + url, { method: 'POST', body: JSON.stringify(body), -- cgit v1.2.3