aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/fund
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/(app)/fund')
-rw-r--r--src/routes/(app)/fund/[id]/+page.server.js4
-rw-r--r--src/routes/(app)/fund/[id]/sweep/+page.server.js4
-rw-r--r--src/routes/(app)/fund/[id]/withdraw/+page.server.js4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/routes/(app)/fund/[id]/+page.server.js b/src/routes/(app)/fund/[id]/+page.server.js
index 6c5c943f..c5c8db2f 100644
--- a/src/routes/(app)/fund/[id]/+page.server.js
+++ b/src/routes/(app)/fund/[id]/+page.server.js
@@ -15,9 +15,9 @@ export const actions = {
if (user) {
await post("/redeem", params, auth(cookies));
- throw redirect(307, `/${user.username}/payments`);
+ redirect(307, `/${user.username}/payments`);
}
- throw redirect(307, "/register");
+ redirect(307, "/register");
},
};
diff --git a/src/routes/(app)/fund/[id]/sweep/+page.server.js b/src/routes/(app)/fund/[id]/sweep/+page.server.js
index 05fb18b6..613cf8e2 100644
--- a/src/routes/(app)/fund/[id]/sweep/+page.server.js
+++ b/src/routes/(app)/fund/[id]/sweep/+page.server.js
@@ -6,8 +6,8 @@ export async function load({ cookies, params, parent }) {
let { id } = params;
let { amount } = await get(`/fund/${id}`);
- if (!amount) throw redirect(307, `/fund/${id}`);
- if (!user) throw redirect(307, `/register?redirect=/fund/${id}/sweep`);
+ if (!amount) redirect(307, `/fund/${id}`);
+ if (!user) redirect(307, `/register?redirect=/fund/${id}/sweep`);
await post("/take", { amount, id }, auth(cookies));
return { amount, id };
}
diff --git a/src/routes/(app)/fund/[id]/withdraw/+page.server.js b/src/routes/(app)/fund/[id]/withdraw/+page.server.js
index 6fb08f61..1da349f8 100644
--- a/src/routes/(app)/fund/[id]/withdraw/+page.server.js
+++ b/src/routes/(app)/fund/[id]/withdraw/+page.server.js
@@ -3,7 +3,7 @@ import { fd, auth, post } from "$lib/utils";
export async function load({ parent }) {
let { user } = await parent();
- if (!user) throw redirect(307, "/register");
+ if (!user) redirect(307, "/register");
}
export const actions = {
@@ -15,6 +15,6 @@ export const actions = {
return fail(400, { message: e.message });
}
- throw redirect(307, `/fund/${body.id}`);
+ redirect(307, `/fund/${body.id}`);
},
};