Fix build and run issues
All checks were successful
CI / Go tests & lint (push) Successful in 8s
CI / Frontend tests & type-check (push) Successful in 40s
CI / Go tests & lint (pull_request) Successful in 7s
CI / Frontend tests & type-check (pull_request) Successful in 35s

This commit is contained in:
2026-04-08 14:58:58 -03:00
parent 9905234b34
commit e82a39f2e4
7 changed files with 34 additions and 29 deletions

View File

@@ -213,7 +213,7 @@ export interface Notification {
id: number;
volunteer_id: number;
message: string;
read: boolean;
is_read: boolean;
created_at: string;
}

View File

@@ -44,7 +44,7 @@ export default function Dashboard() {
async function handleMarkRead(id: number) {
try {
await api.markRead(id);
setNotifications(prev => prev.map(n => n.id === id ? { ...n, read: true } : n));
setNotifications(prev => prev.map(n => n.id === id ? { ...n, is_read: true } : n));
} catch {}
}
@@ -52,7 +52,7 @@ export default function Dashboard() {
.filter(s => new Date(s.date) >= now)
.slice(0, 5);
const unreadNotifications = notifications.filter(n => !n.read);
const unreadNotifications = notifications.filter(n => !n.is_read);
return (
<div className="page">
@@ -93,9 +93,9 @@ export default function Dashboard() {
) : (
<ul>
{notifications.map(n => (
<li key={n.id} className={n.read ? 'read' : 'unread'}>
<li key={n.id} className={n.is_read ? 'read' : 'unread'}>
{n.message}
{!n.read && (
{!n.is_read && (
<button className="btn-small" onClick={() => handleMarkRead(n.id)}>Mark read</button>
)}
</li>