feat: Added feature to allow users to give directions for study spaces. These... #54
@@ -26,6 +26,7 @@
|
|||||||
const { error: feedbackUpload } = await supabase
|
const { error: feedbackUpload } = await supabase
|
||||||
.from("study_spaces")
|
.from("study_spaces")
|
||||||
.update({
|
.update({
|
||||||
|
directions: newStudySpaceData.directions,
|
||||||
volume: newStudySpaceData.volume,
|
volume: newStudySpaceData.volume,
|
||||||
wifi: newStudySpaceData.wifi,
|
wifi: newStudySpaceData.wifi,
|
||||||
power: newStudySpaceData.power,
|
power: newStudySpaceData.power,
|
||||||
|
|||||||
3
src/lib/database.d.ts
vendored
3
src/lib/database.d.ts
vendored
@@ -145,6 +145,7 @@ export type Database = {
|
|||||||
building_location_old: string | null
|
building_location_old: string | null
|
||||||
created_at: string | null
|
created_at: string | null
|
||||||
description: string | null
|
description: string | null
|
||||||
|
directions: string
|
||||||
id: string
|
id: string
|
||||||
location: string | null
|
location: string | null
|
||||||
power: string
|
power: string
|
||||||
@@ -158,6 +159,7 @@ export type Database = {
|
|||||||
building_location_old?: string | null
|
building_location_old?: string | null
|
||||||
created_at?: string | null
|
created_at?: string | null
|
||||||
description?: string | null
|
description?: string | null
|
||||||
|
directions: string
|
||||||
id?: string
|
id?: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
power: string
|
power: string
|
||||||
@@ -171,6 +173,7 @@ export type Database = {
|
|||||||
building_location_old?: string | null
|
building_location_old?: string | null
|
||||||
created_at?: string | null
|
created_at?: string | null
|
||||||
description?: string | null
|
description?: string | null
|
||||||
|
directions: string
|
||||||
id?: string
|
id?: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
power?: string
|
power?: string
|
||||||
|
|||||||
@@ -167,6 +167,11 @@
|
|||||||
{/each}
|
{/each}
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
|
<div class="subtitle">Directions:</div>
|
||||||
|
<p class="addrContainer">
|
||||||
|
{space.directions}
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="subtitle">Where it is:</div>
|
<div class="subtitle">Where it is:</div>
|
||||||
<p class="addrContainer">
|
<p class="addrContainer">
|
||||||
{#if place.name}
|
{#if place.name}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export const load: PageServerLoad = async ({ params, locals: { supabase } }) =>
|
|||||||
return {
|
return {
|
||||||
space: {
|
space: {
|
||||||
description: "",
|
description: "",
|
||||||
|
directions: "",
|
||||||
building_location: undefined,
|
building_location: undefined,
|
||||||
location: "",
|
location: "",
|
||||||
tags: [],
|
tags: [],
|
||||||
|
|||||||
@@ -461,6 +461,14 @@
|
|||||||
rows={2}
|
rows={2}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<label for="directions">Give directions:</label>
|
||||||
|
<Textarea
|
||||||
|
name="directions"
|
||||||
|
bind:value={studySpaceData.directions}
|
||||||
|
placeholder="Turn left once you enter Huxley and walk straight."
|
||||||
|
rows={2}
|
||||||
|
/>
|
||||||
|
|
||||||
<label for="building-location">Add the building location:</label>
|
<label for="building-location">Add the building location:</label>
|
||||||
<Text
|
<Text
|
||||||
name="building-location"
|
name="building-location"
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ ALTER TABLE study_spaces DROP COLUMN title;
|
|||||||
ALTER TABLE study_spaces ADD COLUMN building_address text;
|
ALTER TABLE study_spaces ADD COLUMN building_address text;
|
||||||
ALTER TABLE study_spaces ADD COLUMN description text;
|
ALTER TABLE study_spaces ADD COLUMN description text;
|
||||||
ALTER TABLE study_spaces ADD COLUMN location text;
|
ALTER TABLE study_spaces ADD COLUMN location text;
|
||||||
|
ALTER TABLE study_spaces ADD COLUMN directions text;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ CREATE POLICY "Whack"
|
|||||||
CREATE TABLE study_spaces (
|
CREATE TABLE study_spaces (
|
||||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||||
description text,
|
description text,
|
||||||
|
directions text,
|
||||||
-- Location within building, e.g., "Room 101"
|
-- Location within building, e.g., "Room 101"
|
||||||
location text,
|
location text,
|
||||||
-- Not bothered to write a proper data migration
|
-- Not bothered to write a proper data migration
|
||||||
|
|||||||
Reference in New Issue
Block a user