diff options
| author | Adam Soltys <[email protected]> | 2023-03-11 17:47:15 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-03-11 17:47:15 -0800 |
| commit | f5eaf3eac19e0e2902b894effb14b58cc8c21d2d (patch) | |
| tree | f9a16fcf187ab1657bcc3d97fd5b2df4e35f95e6 /src/routes/(app)/send | |
| parent | ffb2a1c2ccfeb8d6002644e2fcefe60a7fd20d05 (diff) | |
| download | coinos-ui-f5eaf3eac19e0e2902b894effb14b58cc8c21d2d.tar.gz coinos-ui-f5eaf3eac19e0e2902b894effb14b58cc8c21d2d.zip | |
fix param name
Diffstat (limited to 'src/routes/(app)/send')
| -rw-r--r-- | src/routes/(app)/send/invoice/[id]/+page.server.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/routes/(app)/send/invoice/[id]/+page.server.js b/src/routes/(app)/send/invoice/[id]/+page.server.js index 261345fa..c9c2b222 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.server.js +++ b/src/routes/(app)/send/invoice/[id]/+page.server.js @@ -4,18 +4,27 @@ import { fd, auth, get, post } from '$lib/utils'; export async function load({ params: { id }, parent, url }) { let { user } = await parent(); - let { amount, address, rate, prompt, tip, text, user: recipient } = await get(`/invoice/${id}`); + let { + amount, + address, + hash, + rate, + prompt, + tip, + text, + user: recipient + } = await get(`/invoice/${id}`); if (prompt && tip === null) throw redirect(307, `/${recipient.username}/invoice/${id}/tip`); if (recipient.username === user.username) throw error(500, { message: 'Cannot send to self' }); - return { amount, address, tip, rate, payreq: text, recipient }; + return { amount, address, hash, tip, rate, payreq: text, recipient }; } export const actions = { - default: async ({ cookies, params: { hash }, request }) => { + default: async ({ cookies, params: { id }, request }) => { try { let body = await fd(request); - body.hash = hash; + body.hash = id; await post('/payments', body, auth(cookies)); } catch (e) { |
