aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/fund
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-15 15:24:43 -0800
committerAdam Soltys <[email protected]>2023-12-15 15:24:43 -0800
commit7d598265e60eecf06a27501a85e8db330aeed381 (patch)
tree80c73666f5ba3c5f852ac961dd0cf01e551c7896 /src/routes/(app)/fund
parent310687af30375e87679ea5a9ff3fef5a8f4f12fa (diff)
downloadcoinos-ui-7d598265e60eecf06a27501a85e8db330aeed381.tar.gz
coinos-ui-7d598265e60eecf06a27501a85e8db330aeed381.zip
sveltekit 2
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}`);
},
};