From fb8510db273f78317a02ca151f7f24a9b8de29ab Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 20 Sep 2024 10:03:30 -0700 Subject: rename account_id --- src/routes/(app)/invoice/+page.server.ts | 6 +++--- src/routes/(app)/invoice/[id]/+page.svelte | 6 +++--- src/routes/(app)/invoice/[id]/tip/+page.svelte | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/routes/(app)/invoice') diff --git a/src/routes/(app)/invoice/+page.server.ts b/src/routes/(app)/invoice/+page.server.ts index 98bbe8c3..7bac3f9b 100644 --- a/src/routes/(app)/invoice/+page.server.ts +++ b/src/routes/(app)/invoice/+page.server.ts @@ -3,18 +3,18 @@ import { error, redirect } from "@sveltejs/kit"; import type { Invoice } from "$lib/types"; export let load = async ({ cookies, parent }) => { - let account_id = cookies.get("account_id"); + let aid = cookies.get("aid"); let { subject, user, rates } = await parent(); let invoice: Invoice = { - account_id, + aid, rate: rates[user?.currency || subject?.currency], }; if (!user) user = subject; try { - invoice = await post("/invoice", { invoice, account_id, user }, auth(cookies)); + invoice = await post("/invoice", { invoice, aid, user }, auth(cookies)); } catch (e) { console.log(e); error(500, "Failed to generate invoice"); diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte index 321129a8..580456cd 100644 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ b/src/routes/(app)/invoice/[id]/+page.svelte @@ -40,7 +40,7 @@ $: refresh(data); let { invoice, id, subject, user, src } = data; let { - account_id, + aid, amount, hash, type, @@ -56,7 +56,7 @@ let refresh = async (data) => { ({ invoice, id, user, src } = data); ({ - account_id, + aid, amount, hash, type, @@ -236,7 +236,7 @@ - {#if account_id === user.id} + {#if aid === user.id}