From 3897450bc207286e968be1a3bbfe825682bfd0cc Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Wed, 6 Aug 2025 00:30:27 +0000 Subject: [PATCH] Update updateProfile method to use AeThex adapter cgen-a68e0b3357314215b8d5e80b29212eea --- client/contexts/AuthContext.tsx | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/client/contexts/AuthContext.tsx b/client/contexts/AuthContext.tsx index c449a4b7..da1c13e8 100644 --- a/client/contexts/AuthContext.tsx +++ b/client/contexts/AuthContext.tsx @@ -194,13 +194,13 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children } }; - const updateProfile = async (updates: Partial) => { + const updateProfile = async (updates: Partial) => { if (!user) throw new Error('No user logged in'); if (!isSupabaseConfigured) { // Use demo storage - const updatedProfile = DemoStorageService.updateUserProfile(updates); - setProfile(updatedProfile); + const updatedProfile = DemoStorageService.updateUserProfile(updates as any); + setProfile(updatedProfile as AethexUserProfile); aethexToast.success({ title: 'Profile updated', description: 'Your profile has been updated successfully' @@ -209,16 +209,8 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children } try { - const { data, error } = await supabase - .from('user_profiles') - .update(updates) - .eq('id', user.id) - .select() - .single(); - - if (error) throw error; - - setProfile(data); + const updatedProfile = await aethexUserService.updateProfile(user.id, updates); + setProfile(updatedProfile); aethexToast.success({ title: 'Profile updated', description: 'Your profile has been updated successfully'