(id: string)
| 93 | }, [isOpen]); |
| 94 | |
| 95 | const markAsRead = async (id: string) => { |
| 96 | try { |
| 97 | await fetch("/api/notifications", { |
| 98 | method: "PATCH", |
| 99 | headers: { "Content-Type": "application/json" }, |
| 100 | body: JSON.stringify({ id, read: true }), |
| 101 | }); |
| 102 | await fetchNotifications(); |
| 103 | } catch (error) { |
| 104 | console.error("Failed to mark as read:", error); |
| 105 | } |
| 106 | }; |
| 107 | |
| 108 | const markAllAsRead = async () => { |
| 109 | try { |
no test coverage detected