aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/(app)')
-rw-r--r--src/routes/(app)/invoices/+page.server.ts7
-rw-r--r--src/routes/(app)/invoices/+page.svelte9
2 files changed, 16 insertions, 0 deletions
diff --git a/src/routes/(app)/invoices/+page.server.ts b/src/routes/(app)/invoices/+page.server.ts
new file mode 100644
index 00000000..081d6a5b
--- /dev/null
+++ b/src/routes/(app)/invoices/+page.server.ts
@@ -0,0 +1,7 @@
+import { auth, get } from "$lib/utils";
+
+export async function load({ cookies }) {
+ const invoices = await get("/invoices", auth(cookies));
+ console.log(invoices.length)
+ return { invoices };
+}
diff --git a/src/routes/(app)/invoices/+page.svelte b/src/routes/(app)/invoices/+page.svelte
new file mode 100644
index 00000000..ffbc550e
--- /dev/null
+++ b/src/routes/(app)/invoices/+page.svelte
@@ -0,0 +1,9 @@
+<script>
+ let { data } = $props();
+ let { invoices } = $derived(data);
+</script>
+
+{invoices.length}
+{#each invoices as i}
+ {JSON.stringify(i)}
+{/each}