aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts b/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts
index 8a8e71ee..d0e49fcc 100644
--- a/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts
+++ b/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.server.ts
@@ -36,10 +36,13 @@ export async function load({ cookies, request, params, parent }) {
await register(user, ip, cookies, `/fund/${id}/sweep`);
}
+ let r;
try {
- await post("/take", { amount, id }, auth(cookies));
+ r = await post("/take", { amount, id }, auth(cookies));
} catch (e) {
redirect(307, `/fund/${id}`);
}
+
+ if (r) redirect(307, `/${user.username}`);
return { amount, currency, id, rate, rates, password };
}