diff --git a/src/stores/elo.ts b/src/stores/elo.ts index 8871e4d..f1010e0 100644 --- a/src/stores/elo.ts +++ b/src/stores/elo.ts @@ -72,7 +72,11 @@ export const useEloStore = defineStore('elo', { }, async upsertElo(userId: string, gameType: GameType, elo: number) { - await supabase.from('elo').upsert({ id: userId, [gameType]: elo }) + await supabase.from('elo').upsert({ + id: userId, + [gameType]: elo, + lastUpdate: new Date().toISOString(), + }) }, async fetchPersonalElo() { @@ -80,7 +84,7 @@ export const useEloStore = defineStore('elo', { if (!userId) return const eloResponse = await supabase .from('elo') - .select('x01, rtc, killer, skovhugger, cricket') + .select('*') .eq('id', userId) if (eloResponse.data?.length) { this.personalElo = eloResponse.data[0] diff --git a/src/types/supabase.ts b/src/types/supabase.ts index be203d3..d477387 100644 --- a/src/types/supabase.ts +++ b/src/types/supabase.ts @@ -14,6 +14,7 @@ export type Database = { cricket: number | null id: string killer: number | null + lastUpdate: string | null rtc: number | null skovhugger: number | null x01: number | null @@ -22,6 +23,7 @@ export type Database = { cricket?: number | null id: string killer?: number | null + lastUpdate?: string | null rtc?: number | null skovhugger?: number | null x01?: number | null @@ -30,6 +32,7 @@ export type Database = { cricket?: number | null id?: string killer?: number | null + lastUpdate?: string | null rtc?: number | null skovhugger?: number | null x01?: number | null