diff options
| author | Adam Soltys <[email protected]> | 2024-09-19 15:55:38 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-09-19 15:55:38 -0700 |
| commit | d4c3d52fdde5fef8f72c1f572f1ce7c70da86b23 (patch) | |
| tree | f523771b8645ed2e76dc08be4521788c59561397 /src/routes/(app)/invoice/+page.server.ts | |
| parent | 072cb81c886d7461a6e1ffce9d658d1463ca6315 (diff) | |
| download | coinos-ui-d4c3d52fdde5fef8f72c1f572f1ce7c70da86b23.tar.gz coinos-ui-d4c3d52fdde5fef8f72c1f572f1ce7c70da86b23.zip | |
progress on accounts
Diffstat (limited to 'src/routes/(app)/invoice/+page.server.ts')
| -rw-r--r-- | src/routes/(app)/invoice/+page.server.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/routes/(app)/invoice/+page.server.ts b/src/routes/(app)/invoice/+page.server.ts index 05851430..98bbe8c3 100644 --- a/src/routes/(app)/invoice/+page.server.ts +++ b/src/routes/(app)/invoice/+page.server.ts @@ -3,19 +3,18 @@ import { error, redirect } from "@sveltejs/kit"; import type { Invoice } from "$lib/types"; export let load = async ({ cookies, parent }) => { - let account = cookies.get("account"); + let account_id = cookies.get("account_id"); let { subject, user, rates } = await parent(); let invoice: Invoice = { - account, - type: account ? "bitcoin" : "lightning", + account_id, rate: rates[user?.currency || subject?.currency], }; if (!user) user = subject; try { - invoice = await post("/invoice", { invoice, account, user }, auth(cookies)); + invoice = await post("/invoice", { invoice, account_id, user }, auth(cookies)); } catch (e) { console.log(e); error(500, "Failed to generate invoice"); |
