From a8d18ab66a8beb203b8ff0a056810000a3e069ea Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 9 Sep 2025 12:38:40 -0700 Subject: redirect to paid route --- src/routes/(app)/invoice/[id]/+layout.server.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/routes/(app)') diff --git a/src/routes/(app)/invoice/[id]/+layout.server.ts b/src/routes/(app)/invoice/[id]/+layout.server.ts index df8693be..ab41dddc 100644 --- a/src/routes/(app)/invoice/[id]/+layout.server.ts +++ b/src/routes/(app)/invoice/[id]/+layout.server.ts @@ -19,9 +19,7 @@ export async function load({ cookies, depends, params, url, parent }) { (!amount && (pending || received)) || (amount > 0 && (pending >= amount || received >= amount)); if (paid && !url.pathname.endsWith("paid")) { - if (invoice.uid === user?.id) - redirect(307, `/invoice/${id}/paid` + (options ? "?options=true" : "")); - else redirect(307, `/pay/${subject.username}/${invoice.amount}`); + redirect(307, `/invoice/${id}/paid` + (options ? "?options=true" : "")); } subject = invoice.user; @@ -34,7 +32,9 @@ export async function load({ cookies, depends, params, url, parent }) { ) { if (invoice.prompt && invoice.tip === null) redirect(307, `/invoice/${id}/tip`); - else redirect(307, `/send/invoice/${id}`); + else { + redirect(307, `/send/invoice/${id}`); + } } } -- cgit v1.2.3