From 08ce78dbd97ad792e163482f454f285557c7cdd0 Mon Sep 17 00:00:00 2001 From: Alberto Duarte Delgado Date: Wed, 1 Apr 2026 13:03:25 +0100 Subject: Mejoras de UX y feedback de errores; y, manejo de status de reserva --- src/features/offices/hooks/useOffice.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/features/offices/hooks/useOffice.ts') diff --git a/src/features/offices/hooks/useOffice.ts b/src/features/offices/hooks/useOffice.ts index 87d47b5..c737719 100644 --- a/src/features/offices/hooks/useOffice.ts +++ b/src/features/offices/hooks/useOffice.ts @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react'; import { officesService } from '@/features/offices/services/officesService'; import { Office } from '@/features/offices/types'; +import { getErrorMessage } from '@/shared/lib/errors/getErrorMessage'; export function useOffice(officeId?: string) { const [office, setOffice] = useState(null); @@ -27,8 +28,8 @@ export function useOffice(officeId?: string) { } setOffice(data); - } catch (err: any) { - setError(err?.message ?? 'No se pudo cargar la oficina'); + } catch (err) { + setError(getErrorMessage(err, 'No se pudo cargar la oficina')); } finally { setLoading(false); } -- cgit v1.2.3-54-g00ecf