aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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 };