diff --git a/ApiCore-Frontend/src/app/(app)/equipment/[id]/page.tsx b/ApiCore-Frontend/src/app/(app)/equipment/[id]/page.tsx index 6555e59..1f291bb 100644 --- a/ApiCore-Frontend/src/app/(app)/equipment/[id]/page.tsx +++ b/ApiCore-Frontend/src/app/(app)/equipment/[id]/page.tsx @@ -3,6 +3,7 @@ import { useParams } from "next/navigation"; import { Wrench } from "lucide-react"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; +import { toast } from "sonner"; import { fetchEquipment, updateEquipment } from "@/lib/equipment/api"; import { EquipmentCondition } from "@/lib/equipment/types"; import { EQUIPMENT_CONDITIONS, EQUIPMENT_CONDITION_LABELS } from "@/lib/equipment/labels"; @@ -32,6 +33,7 @@ export default function EquipmentDetailPage() { void queryClient.invalidateQueries({ queryKey: ["equipment", params.id] }); void queryClient.invalidateQueries({ queryKey: ["equipment"] }); }, + onError: () => toast.error("Zustand konnte nicht gespeichert werden"), }); if (isLoading) { diff --git a/ApiCore-Frontend/src/app/(app)/tasks/page.tsx b/ApiCore-Frontend/src/app/(app)/tasks/page.tsx index 5abe844..16b335e 100644 --- a/ApiCore-Frontend/src/app/(app)/tasks/page.tsx +++ b/ApiCore-Frontend/src/app/(app)/tasks/page.tsx @@ -4,6 +4,7 @@ import { useState } from "react"; import Link from "next/link"; import { ListTodo } from "lucide-react"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; +import { toast } from "sonner"; import { completeTask, fetchTasks } from "@/lib/tasks/api"; import { TaskPriority, TaskStatus } from "@/lib/tasks/types"; import { TASK_PRIORITIES, TASK_PRIORITY_LABELS, TASK_STATUS_LABELS } from "@/lib/tasks/labels"; @@ -40,6 +41,7 @@ export default function TasksPage() { onSuccess: () => { void queryClient.invalidateQueries({ queryKey: ["tasks"] }); }, + onError: () => toast.error("Aufgabe konnte nicht erledigt werden"), }); const [now] = useState(() => Date.now()); diff --git a/ApiCore-Frontend/src/components/notification-bell.tsx b/ApiCore-Frontend/src/components/notification-bell.tsx index 61fe39f..7339931 100644 --- a/ApiCore-Frontend/src/components/notification-bell.tsx +++ b/ApiCore-Frontend/src/components/notification-bell.tsx @@ -3,6 +3,7 @@ import Link from "next/link"; import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; import { Bell } from "lucide-react"; +import { toast } from "sonner"; import { fetchNotifications, markNotificationRead } from "@/lib/notifications/api"; import { Notification, NotificationPriority } from "@/lib/notifications/types"; import { Badge, badgeVariants } from "@/components/ui/badge"; @@ -41,6 +42,7 @@ export function NotificationBell() { onSuccess: () => { void queryClient.invalidateQueries({ queryKey: ["notifications"] }); }, + onError: () => toast.error("Benachrichtigung konnte nicht als gelesen markiert werden"), }); const unreadCount = notifications?.filter((notification) => !notification.read).length ?? 0; diff --git a/ApiCore-Frontend/src/components/offline-sync-badge.tsx b/ApiCore-Frontend/src/components/offline-sync-badge.tsx index aae8f99..45f4507 100644 --- a/ApiCore-Frontend/src/components/offline-sync-badge.tsx +++ b/ApiCore-Frontend/src/components/offline-sync-badge.tsx @@ -26,7 +26,14 @@ export function OfflineSyncBadge() { if (result.synced > 0) { toast.success(`${result.synced} Eintrag/Einträge synchronisiert`); } + if (result.failed > 0) { + toast.error( + `${result.failed} Eintrag/Einträge konnten nicht synchronisiert werden und bleiben in der Warteschlange`, + ); + } }, + onError: () => + toast.error("Synchronisierung fehlgeschlagen - wird beim nächsten Versuch erneut versucht"), }); useEffect(() => {