mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 08:11:13 -05:00
Fix duplicate key error
This commit is contained in:
@@ -104,12 +104,14 @@ export function LocationTab() {
|
|||||||
|
|
||||||
if (profileError) throw profileError;
|
if (profileError) throw profileError;
|
||||||
|
|
||||||
// Save accessibility preferences
|
// Save accessibility preferences - update existing record
|
||||||
const { error: accessibilityError } = await supabase.from('user_preferences').upsert([{
|
const { error: accessibilityError } = await supabase
|
||||||
user_id: user.id,
|
.from('user_preferences')
|
||||||
accessibility_options: accessibility as any,
|
.update({
|
||||||
updated_at: new Date().toISOString()
|
accessibility_options: accessibility as any,
|
||||||
}]);
|
updated_at: new Date().toISOString()
|
||||||
|
})
|
||||||
|
.eq('user_id', user.id);
|
||||||
|
|
||||||
if (accessibilityError) throw accessibilityError;
|
if (accessibilityError) throw accessibilityError;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user