diff options
| author | Adam Soltys <[email protected]> | 2022-08-01 22:56:41 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-08-01 22:56:41 -0700 |
| commit | 63a4af3686b7a81874a87259f6ec5dd44aa97e48 (patch) | |
| tree | 78f9104ff3b97f99c3e9aaa95fbf63acc064d556 /src/lib/utils.js | |
| parent | b83994d6fb38981607c2cd4d460173457377a9ba (diff) | |
| download | coinos-ui-63a4af3686b7a81874a87259f6ec5dd44aa97e48.tar.gz coinos-ui-63a4af3686b7a81874a87259f6ec5dd44aa97e48.zip | |
404 on invalid user
Diffstat (limited to 'src/lib/utils.js')
| -rw-r--r-- | src/lib/utils.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/utils.js b/src/lib/utils.js index b80a548b..db8a490a 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -6,10 +6,8 @@ export function scroll(section) { const base = browser ? '' : import.meta.env.VITE_COINOS_URL; -export const get = (url) => - fetch(base + url, { - headers: { accept: 'application/json' } - }) +export const get = (url, headers = { accept: 'application/json' }) => + fetch(base + url, { headers }) .then((r) => r.text()) .then((body) => { try { @@ -38,3 +36,5 @@ export function reverseFormat(val, locale) { reversedVal = reversedVal.replace(new RegExp('\\' + decimal, 'g'), '.'); return Number.isNaN(reversedVal) ? 0 : +reversedVal; } + +export let protectedRoutes = [/receive/, /customers/, /dashboard/, /settings/, /transactions/]; |
