aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/funds/+page.server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/(app)/funds/+page.server.ts')
-rw-r--r--src/routes/(app)/funds/+page.server.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/routes/(app)/funds/+page.server.ts b/src/routes/(app)/funds/+page.server.ts
new file mode 100644
index 00000000..e6836596
--- /dev/null
+++ b/src/routes/(app)/funds/+page.server.ts
@@ -0,0 +1,10 @@
+import getRates from "$lib/rates";
+import { auth, get } from "$lib/utils";
+
+export const load = async ({ cookies, parent }) => {
+ const { user } = await parent();
+ const funds = await get("/funds", auth(cookies));
+ const rates = await getRates();
+ const rate = rates[user?.currency || "USD"];
+ return { funds, rate };
+};