From f4517ef46720967490e309eefa7283d0d53b146f Mon Sep 17 00:00:00 2001 From: TadiosT Date: Fri, 13 Jun 2025 13:06:10 +0100 Subject: [PATCH 1/2] feat: Added feature to allow users to give directions for study spaces. These directions appear when you click on a study space. Co-authored-by: Asaam, Caspar --- src/lib/database.d.ts | 3 +++ src/routes/space/[id]/+page.svelte | 7 ++++++- src/routes/space/[id]/edit/+page.server.ts | 1 + src/routes/space/[id]/edit/+page.svelte | 8 ++++++++ .../migrations/20250604100124_study_space_addresses.sql | 1 + supabase/schemas/0001_study_spaces.sql | 1 + 6 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/lib/database.d.ts b/src/lib/database.d.ts index 64842ee..90386f3 100644 --- a/src/lib/database.d.ts +++ b/src/lib/database.d.ts @@ -145,6 +145,7 @@ export type Database = { building_location_old: string | null created_at: string | null description: string | null + directions: string id: string location: string | null power: string @@ -158,6 +159,7 @@ export type Database = { building_location_old?: string | null created_at?: string | null description?: string | null + directions: string id?: string location?: string | null power: string @@ -171,6 +173,7 @@ export type Database = { building_location_old?: string | null created_at?: string | null description?: string | null + directions: string id?: string location?: string | null power?: string diff --git a/src/routes/space/[id]/+page.svelte b/src/routes/space/[id]/+page.svelte index 9e37048..ef5e852 100644 --- a/src/routes/space/[id]/+page.svelte +++ b/src/routes/space/[id]/+page.svelte @@ -166,7 +166,12 @@ {/each}
- + +
Directions:
+

+ {space.directions} +

+
Where it is:

{#if place.name} diff --git a/src/routes/space/[id]/edit/+page.server.ts b/src/routes/space/[id]/edit/+page.server.ts index 66d2c65..831e088 100644 --- a/src/routes/space/[id]/edit/+page.server.ts +++ b/src/routes/space/[id]/edit/+page.server.ts @@ -21,6 +21,7 @@ export const load: PageServerLoad = async ({ params, locals: { supabase } }) => return { space: { description: "", + directions: "", building_location: undefined, location: "", tags: [], diff --git a/src/routes/space/[id]/edit/+page.svelte b/src/routes/space/[id]/edit/+page.svelte index 62888d2..4a40ba1 100644 --- a/src/routes/space/[id]/edit/+page.svelte +++ b/src/routes/space/[id]/edit/+page.svelte @@ -461,6 +461,14 @@ rows={2} /> + +