diff options
| author | Adam Soltys <[email protected]> | 2022-09-05 11:23:59 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-09-05 11:23:59 -0700 |
| commit | 7efa00c9a9cf6587e9c24c1c94d3c8969949e360 (patch) | |
| tree | 0e97ae2fd26963c330a92e1435569333a91d335a /src | |
| parent | a0fc80a1bd391acccee31cd9c3a3cc0fad3d00c6 (diff) | |
| download | coinos-ui-7efa00c9a9cf6587e9c24c1c94d3c8969949e360.tar.gz coinos-ui-7efa00c9a9cf6587e9c24c1c94d3c8969949e360.zip | |
add origin env var
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/utils.js | 4 | ||||
| -rw-r--r-- | src/routes/login/+page.server.js | 2 |
2 files changed, 3 insertions, 3 deletions
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), diff --git a/src/routes/login/+page.server.js b/src/routes/login/+page.server.js index cfa4c4cc..7c4eb295 100644 --- a/src/routes/login/+page.server.js +++ b/src/routes/login/+page.server.js @@ -1,4 +1,4 @@ -import { login, post } from '$lib/utils'; +import { login } from '$lib/utils'; export async function POST({ setHeaders, request }) { let user = Object.fromEntries(await request.formData()); |
