diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/invoice.js | 2 | ||||
| -rw-r--r-- | src/routes/(app)/[username]/invoice/[id]/tip/+page.svelte | 2 | ||||
| -rw-r--r-- | src/routes/(app)/send/invoice/[id]/+page.server.js | 4 |
3 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/invoice.js b/src/lib/invoice.js index ea6dbf69..d2f70146 100644 --- a/src/lib/invoice.js +++ b/src/lib/invoice.js @@ -11,7 +11,7 @@ export default async ({ cookies, request, url }) => { let invoice = { amount, - items: form.get("items"), + items: JSON.parse(form.get("items")), tip: parseInt(form.get("tip")) || 0, type: form.get("type"), prompt: form.get("prompt") === "true", diff --git a/src/routes/(app)/[username]/invoice/[id]/tip/+page.svelte b/src/routes/(app)/[username]/invoice/[id]/tip/+page.svelte index 10fbb239..e9472118 100644 --- a/src/routes/(app)/[username]/invoice/[id]/tip/+page.svelte +++ b/src/routes/(app)/[username]/invoice/[id]/tip/+page.svelte @@ -118,7 +118,7 @@ <input type="hidden" name="prompt" value="false" /> <input type="hidden" name="type" value={type} /> <input type="hidden" name="hash" value={hash} /> - <input type="hidden" name="items" value={items} /> + <input type="hidden" name="items" value={JSON.stringify(items)} /> <input type="hidden" name="request_id" value={invoice.request?.id} /> diff --git a/src/routes/(app)/send/invoice/[id]/+page.server.js b/src/routes/(app)/send/invoice/[id]/+page.server.js index b0cbef45..dcf188b2 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.server.js +++ b/src/routes/(app)/send/invoice/[id]/+page.server.js @@ -6,8 +6,6 @@ export async function load({ params: { id }, parent, url }) { let invoice = await get(`/invoice/${id}`); - console.log("OH", invoice, invoice.prompt, invoice.tip); - if (invoice.prompt && invoice.tip === null) redirect(307, `/${invoice.user.username}/invoice/${id}/tip`); if (invoice.user.username === user.username) @@ -24,7 +22,7 @@ export const actions = { await post("/payments", body, auth(cookies)); } catch (e) { - console.log("payment failed", params, e); + console.log("payment failed", id, e); return fail(400, { message: e.message }); } |
