diff --git a/src/pages/Player.tsx b/src/pages/Player.tsx index 41d4385..6a29e20 100644 --- a/src/pages/Player.tsx +++ b/src/pages/Player.tsx @@ -19,8 +19,8 @@ const Player = () => { return

Loading...

; } - if (!player) { - return

This player does not exist on runefinder.

; + if (!player?.username) { + return

This player does not exist on RuneFinder.

; } const isPlayerMe = player.id === user?.id; diff --git a/src/types/supabase.ts b/src/types/supabase.ts index 08ad8e2..6e41dc1 100644 --- a/src/types/supabase.ts +++ b/src/types/supabase.ts @@ -48,6 +48,21 @@ export interface Database { }; Relationships: []; }; + badges: { + Row: { + id: number; + name: string; + }; + Insert: { + id?: number; + name: string; + }; + Update: { + id?: number; + name?: string; + }; + Relationships: []; + }; comments: { Row: { comment: string; @@ -100,7 +115,7 @@ export interface Database { }; Insert: { created_at?: string; - created_by?: string; + created_by: string; id?: string; name: string; size: number; @@ -171,6 +186,39 @@ export interface Database { }, ]; }; + user_badges: { + Row: { + badge_id: number; + id: number; + user_id: string; + }; + Insert: { + badge_id: number; + id?: number; + user_id: string; + }; + Update: { + badge_id?: number; + id?: number; + user_id?: string; + }; + Relationships: [ + { + foreignKeyName: 'user_badges_badge_id_fkey'; + columns: ['badge_id']; + isOneToOne: false; + referencedRelation: 'badges'; + referencedColumns: ['id']; + }, + { + foreignKeyName: 'user_badges_user_id_fkey'; + columns: ['user_id']; + isOneToOne: false; + referencedRelation: 'users'; + referencedColumns: ['id']; + }, + ]; + }; users: { Row: { created_at: string;