aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-05-21 23:43:35 -0700
committerAdam Soltys <[email protected]>2023-05-21 23:43:35 -0700
commit1c8dcdf8da603b6273b0d3af40201946f68eccb3 (patch)
tree3b6986ef8ab77e564a4a389d7c03f667fd962cc1 /src
parent5079d276bd3c6d00205fefec7d736c27f99f5351 (diff)
downloadcoinos-ui-1c8dcdf8da603b6273b0d3af40201946f68eccb3.tar.gz
coinos-ui-1c8dcdf8da603b6273b0d3af40201946f68eccb3.zip
redirect to empty pot
Diffstat (limited to 'src')
-rw-r--r--src/routes/(app)/pot/[name]/sweep/+page.server.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/routes/(app)/pot/[name]/sweep/+page.server.js b/src/routes/(app)/pot/[name]/sweep/+page.server.js
index 03e8230a..c2c8051d 100644
--- a/src/routes/(app)/pot/[name]/sweep/+page.server.js
+++ b/src/routes/(app)/pot/[name]/sweep/+page.server.js
@@ -7,6 +7,7 @@ export async function load({ cookies, params, parent }) {
let { amount } = await get(`/pot/${name}`);
+ if (!amount) throw redirect(307, `/pot/${name}`);
if (!user) throw redirect(307, `/register?redirect=/pot/${name}/sweep`);
await post('/take', { amount, name }, auth(cookies));
return { amount, name };