From f893043b00750ad693fc886eb77184598b9c8317 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 17 Sep 2024 20:29:53 -0700 Subject: account deletion --- src/components/Account.svelte | 2 +- src/locales/en.json | 2 +- src/routes/(app)/account/[id]/+page.server.ts | 8 ++++++- src/routes/(app)/account/[id]/+page.svelte | 34 ++++++++++++++++++++++++--- src/routes/(app)/invoice/[id]/+page.svelte | 19 ++++++--------- 5 files changed, 47 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/components/Account.svelte b/src/components/Account.svelte index a8573c37..6294bc44 100644 --- a/src/components/Account.svelte +++ b/src/components/Account.svelte @@ -20,7 +20,7 @@
- diff --git a/src/locales/en.json b/src/locales/en.json index fd2807b4..ba7ebc87 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -331,7 +331,7 @@ "voucher": "Payment code", "qr": "QR", "copy": "Copy", - "amountPrompt": "Always prompt for amount", + "amountPrompt": "Prompt for amount", "shareLink": "Share link", "copyLink": "Copy link", "copyText": "Copy text", diff --git a/src/routes/(app)/account/[id]/+page.server.ts b/src/routes/(app)/account/[id]/+page.server.ts index 7d1c503a..35b5517d 100644 --- a/src/routes/(app)/account/[id]/+page.server.ts +++ b/src/routes/(app)/account/[id]/+page.server.ts @@ -1,5 +1,11 @@ import { error, redirect } from "@sveltejs/kit"; -import { auth, post, fd } from "$lib/utils"; +import { auth, get, post, fd } from "$lib/utils"; + + +export let load = async ({ cookies, params }) => { + let account = await get(`/account/${params.id}`, auth(cookies)); + return { account }; +} export const actions = { default: async ({ cookies, params, request }) => { diff --git a/src/routes/(app)/account/[id]/+page.svelte b/src/routes/(app)/account/[id]/+page.svelte index 152e8dfc..df121168 100644 --- a/src/routes/(app)/account/[id]/+page.svelte +++ b/src/routes/(app)/account/[id]/+page.svelte @@ -1,8 +1,22 @@
@@ -12,10 +26,24 @@
- +
- +
+ + +
diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte index 36f5d261..96ff6406 100644 --- a/src/routes/(app)/invoice/[id]/+page.svelte +++ b/src/routes/(app)/invoice/[id]/+page.svelte @@ -136,14 +136,14 @@ > {txt} {:else} -
+
{txt}
{/if} @@ -188,7 +188,7 @@
{/if} -
+