mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 06:51:12 -05:00
Refactor settings page
This commit is contained in:
@@ -49,7 +49,7 @@ export function LocationTab() {
|
||||
timezone: profile?.timezone || 'UTC',
|
||||
preferred_language: profile?.preferred_language || 'en',
|
||||
personal_location: (profile as any)?.personal_location || '',
|
||||
home_park_id: profile?.location_id || ''
|
||||
home_park_id: (profile as any)?.home_park_id || ''
|
||||
}
|
||||
});
|
||||
useEffect(() => {
|
||||
@@ -98,7 +98,7 @@ export function LocationTab() {
|
||||
timezone: data.timezone,
|
||||
preferred_language: data.preferred_language,
|
||||
personal_location: data.personal_location || null,
|
||||
location_id: data.home_park_id || null,
|
||||
home_park_id: data.home_park_id || null,
|
||||
updated_at: new Date().toISOString()
|
||||
}).eq('user_id', user.id);
|
||||
|
||||
|
||||
@@ -354,6 +354,7 @@ export type Database = {
|
||||
created_at: string
|
||||
date_of_birth: string | null
|
||||
display_name: string | null
|
||||
home_park_id: string | null
|
||||
id: string
|
||||
location_id: string | null
|
||||
park_count: number | null
|
||||
@@ -380,6 +381,7 @@ export type Database = {
|
||||
created_at?: string
|
||||
date_of_birth?: string | null
|
||||
display_name?: string | null
|
||||
home_park_id?: string | null
|
||||
id?: string
|
||||
location_id?: string | null
|
||||
park_count?: number | null
|
||||
@@ -406,6 +408,7 @@ export type Database = {
|
||||
created_at?: string
|
||||
date_of_birth?: string | null
|
||||
display_name?: string | null
|
||||
home_park_id?: string | null
|
||||
id?: string
|
||||
location_id?: string | null
|
||||
park_count?: number | null
|
||||
@@ -424,6 +427,13 @@ export type Database = {
|
||||
username?: string
|
||||
}
|
||||
Relationships: [
|
||||
{
|
||||
foreignKeyName: "profiles_home_park_id_fkey"
|
||||
columns: ["home_park_id"]
|
||||
isOneToOne: false
|
||||
referencedRelation: "parks"
|
||||
referencedColumns: ["id"]
|
||||
},
|
||||
{
|
||||
foreignKeyName: "profiles_location_id_fkey"
|
||||
columns: ["location_id"]
|
||||
|
||||
@@ -105,6 +105,7 @@ export interface Profile {
|
||||
location?: Location;
|
||||
location_id?: string;
|
||||
personal_location?: string;
|
||||
home_park_id?: string;
|
||||
date_of_birth?: string;
|
||||
privacy_level: 'public' | 'friends' | 'private';
|
||||
theme_preference: 'light' | 'dark' | 'system';
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
-- Add home_park_id field to profiles table to store user's selected home park
|
||||
ALTER TABLE public.profiles
|
||||
ADD COLUMN home_park_id UUID REFERENCES public.parks(id);
|
||||
Reference in New Issue
Block a user