From a9b44cbae79e9c01cff07964a45e1c7efa7fb241 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 5 Dec 2024 19:20:36 -0800 Subject: cached rates --- src/routes/(app)/invoice/+page.server.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/routes/(app)/invoice/+page.server.ts') diff --git a/src/routes/(app)/invoice/+page.server.ts b/src/routes/(app)/invoice/+page.server.ts index 8d2f3b7f..db68740d 100644 --- a/src/routes/(app)/invoice/+page.server.ts +++ b/src/routes/(app)/invoice/+page.server.ts @@ -1,10 +1,12 @@ +import getRates from "$lib/rates"; import type { Invoice } from "$lib/types"; import { auth, post } from "$lib/utils"; import { error, redirect } from "@sveltejs/kit"; export const load = async ({ cookies, parent }) => { const aid = cookies.get("aid"); - let { subject, user, rates } = await parent(); + let { subject, user } = await parent(); + const rates = await getRates(); if (aid === user.id) redirect(307, `/${user.username}/receive`); let invoice: Invoice = { -- cgit v1.2.3