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
commit8296dbe6a3e2aea354870e54f09f9363b3d26a42 (patch)
tree3b6986ef8ab77e564a4a389d7c03f667fd962cc1 /src
parentb33a53fcc8656113773bad46107ed536714f27e4 (diff)
downloadcoinos-ui-8296dbe6a3e2aea354870e54f09f9363b3d26a42.tar.gz
coinos-ui-8296dbe6a3e2aea354870e54f09f9363b3d26a42.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 };