From 8296dbe6a3e2aea354870e54f09f9363b3d26a42 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 21 May 2023 23:43:35 -0700 Subject: redirect to empty pot --- src/routes/(app)/pot/[name]/sweep/+page.server.js | 1 + 1 file changed, 1 insertion(+) (limited to 'src') 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 }; -- cgit v1.2.3