diff options
Diffstat (limited to 'src/routes/(app)/pay')
| -rw-r--r-- | src/routes/(app)/pay/[username]/[...amount]/+page.server.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/routes/(app)/pay/[username]/[...amount]/+page.server.ts b/src/routes/(app)/pay/[username]/[...amount]/+page.server.ts index 812b97ec..b0f824ed 100644 --- a/src/routes/(app)/pay/[username]/[...amount]/+page.server.ts +++ b/src/routes/(app)/pay/[username]/[...amount]/+page.server.ts @@ -45,11 +45,8 @@ export const actions = { default: async ({ cookies, request }) => { let id; const body = await fd(request); - console.log("BODY", body); const { amount, rate, prompt, type, username } = body; - console.log("AMT", amount); - try { ({ id } = await post( "/invoice", @@ -69,7 +66,8 @@ export const actions = { return fail(400, { message }); } - if (prompt) redirect(307, `/invoice/${id}/tip`); + if (parseInt(amount) > 0 && prompt) redirect(307, `/invoice/${id}/tip`); + else if (parseInt(amount) <= 0 ) redirect(307, `/${username}/receive`); redirect(307, `/invoice/${id}`); }, }; |
