feat: walking skeleton - study space uploads

This commit is contained in:
2025-05-30 11:13:35 +01:00
parent 00944faf1e
commit d7db89e13c
12 changed files with 516 additions and 14 deletions

View File

@@ -0,0 +1,18 @@
import { createClient } from "@supabase/supabase-js";
import { PUBLIC_SUPABASE_ANON_KEY, PUBLIC_SUPABASE_URL } from "$env/static/public";
import type { PageServerLoad } from "./$types";
import type { Database } from "$lib/database";
import { error } from "@sveltejs/kit";
export const load: PageServerLoad = async ({ depends }) => {
depends("db:study_spaces");
const supabase = createClient<Database>(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY);
const { data: studySpaces, error: err } = await supabase
.from("study_spaces")
.select("*, study_space_images(*)");
if (err) error(500, "Failed to load study spaces");
return {
studySpaces
};
};