From 6822d56e11cc131a378b86fa4958f95db619a311 Mon Sep 17 00:00:00 2001 From: dmolinari Date: Thu, 16 Apr 2026 10:11:04 -0300 Subject: [PATCH] fix(web): montar Toaster + feedback toast en PermisosEditor [UDT-009] Sonner estaba como dependencia pero el componente Toaster nunca se monto en el arbol de la app. ChangeMyPasswordPage ya usaba toast() pero no mostraba nada visualmente. Agregado en App.tsx (top-right) y toasts de exito/error en PermisosEditor.handleSave para confirmar al usuario que el cambio se persistio. --- src/web/src/App.tsx | 2 ++ src/web/src/features/users/components/PermisosEditor.tsx | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/web/src/App.tsx b/src/web/src/App.tsx index b4926b2..8286e98 100644 --- a/src/web/src/App.tsx +++ b/src/web/src/App.tsx @@ -1,5 +1,6 @@ import { BrowserRouter } from 'react-router-dom' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' +import { Toaster } from 'sonner' import { AppRoutes } from './router' const queryClient = new QueryClient({ @@ -15,6 +16,7 @@ function App() { + ) } diff --git a/src/web/src/features/users/components/PermisosEditor.tsx b/src/web/src/features/users/components/PermisosEditor.tsx index 10c339b..5c52747 100644 --- a/src/web/src/features/users/components/PermisosEditor.tsx +++ b/src/web/src/features/users/components/PermisosEditor.tsx @@ -1,5 +1,6 @@ import { useState, useEffect } from 'react' import { isAxiosError } from 'axios' +import { toast } from 'sonner' import { AlertCircle } from 'lucide-react' import { Alert, AlertDescription } from '@/components/ui/alert' import { Button } from '@/components/ui/button' @@ -116,10 +117,13 @@ export function PermisosEditor({ userId }: PermisosEditorProps) { { grant, deny }, { onError: (err) => { - setSaveError(resolveErrorMessage(err)) + const msg = resolveErrorMessage(err) + setSaveError(msg) + toast.error(msg) }, onSuccess: () => { setSaveError(null) + toast.success('Permisos actualizados correctamente') }, }, )