feat: initial uploads and single study space view
Co-Authored-By: Alex Ling <al443@ic.ac.uk>
This commit is contained in:
13
src/routes/space/[id]/+page.server.ts
Normal file
13
src/routes/space/[id]/+page.server.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { error } from "@sveltejs/kit";
|
||||
import type { PageServerLoad } from "./$types";
|
||||
|
||||
export const load: PageServerLoad = async ({ params, locals: { supabase } }) => {
|
||||
const { data: space, error: err } = await supabase
|
||||
.from("study_spaces")
|
||||
.select("*, study_space_images(*)")
|
||||
.eq("id", params.id)
|
||||
.single();
|
||||
if (err) error(500, "Failed to load study space");
|
||||
|
||||
return { space };
|
||||
};
|
||||
Reference in New Issue
Block a user