Loading data from network...
export async function postNotification(notification) {
try {
await fetch('/api/notifications', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(notification)
})
} catch {
// ignore network errors in MVP
}
}
export async function fetchNotifications() {
try {
const response = await fetch('/api/notifications')
if (!response.ok) return []
const data = await response.json()
return Array.isArray(data) ? data : []
} catch {
return []
}
}