summaryrefslogtreecommitdiffstats
path: root/src/features/profile/hooks/useUpdateProfile.ts
diff options
context:
space:
mode:
authorAlberto Duarte Delgado <alberto@albertoduarte.com>2026-04-01 13:03:25 +0100
committerAlberto Duarte Delgado <alberto@albertoduarte.com>2026-04-01 13:03:25 +0100
commit08ce78dbd97ad792e163482f454f285557c7cdd0 (patch)
tree998ce8d7d48f8344d9ec34691809f2482cde5136 /src/features/profile/hooks/useUpdateProfile.ts
parentc927739f8f221feabb6e19af2c2667eda905a2eb (diff)
Mejoras de UX y feedback de errores; y, manejo de status de reserva
Diffstat (limited to 'src/features/profile/hooks/useUpdateProfile.ts')
-rw-r--r--src/features/profile/hooks/useUpdateProfile.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/features/profile/hooks/useUpdateProfile.ts b/src/features/profile/hooks/useUpdateProfile.ts
index bc069dc..cd4a39a 100644
--- a/src/features/profile/hooks/useUpdateProfile.ts
+++ b/src/features/profile/hooks/useUpdateProfile.ts
@@ -3,6 +3,7 @@
import { useState } from 'react';
import { profileService } from '@/features/profile/services/profileService';
import { useAuthSession } from '@/providers/AuthProvider';
+import { getErrorMessage } from '@/shared/lib/errors/getErrorMessage';
export function useUpdateProfile(initialDisplayName = '', initialPhotoURL = '') {
const { user } = useAuthSession();
@@ -37,8 +38,8 @@ export function useUpdateProfile(initialDisplayName = '', initialPhotoURL = '')
setPhotoURL(photoURL.trim());
setSuccessMessage('Perfil actualizado correctamente');
- } catch (err: any) {
- setError(err?.message ?? 'No se pudo actualizar el perfil');
+ } catch (err) {
+ setError(getErrorMessage(err, 'No se pudo actualizar el perfil'));
} finally {
setIsSubmitting(false);
}