refactor(#54): Strongly type page load

This commit is contained in:
Josh Creek
2024-11-13 15:05:53 +00:00
parent 05a50a0ce0
commit 42663e7032
+3 -2
View File
@@ -1,7 +1,8 @@
import { redirect } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
import { getUserCredits, getUserCreditTransactions } from '$lib/utils/supabase/admin';
export async function load({ locals: { safeGetSession } }) {
export const load: PageServerLoad = async ({ locals: { safeGetSession } }) => {
const { session } = await safeGetSession();
if (!session) {
@@ -42,4 +43,4 @@ export async function load({ locals: { safeGetSession } }) {
error: error.message
};
}
}
};