import request from '@/utils/request' // Backend general inbox only. Announcements and collaboration notifications retain their existing APIs. // Render title/content as plain text. Never use v-html for notification content. export const listNotifications = ({ beforeId, limit = 20, unreadOnly = false } = {}) => request({ url: '/system/notifications', params: { beforeId, limit, unreadOnly } }) // Returns { count, exact }; exact=false means a lower bound, not an exact unread badge. export const notificationUnread = () => request({ url: '/system/notifications/unread' }) export const getNotification = id => request({ url: `/system/notifications/${id}` }) export const readNotification = id => request({ url: `/system/notifications/${id}/read`, method: 'put' }) export const readNotificationBatch = ids => request({ url: '/system/notifications/read-batch', method: 'put', data: ids })