feat(admin): add GET /api/admin/alerts endpoint

This commit is contained in:
Jennie Robinson Faber 2026-04-08 11:17:50 +01:00
parent 4f7a11bcf3
commit f0284c60b4
2 changed files with 97 additions and 0 deletions

View file

@ -0,0 +1,8 @@
import { computeAllAlerts } from '../../../utils/adminAlerts.js'
export default defineEventHandler(async (event) => {
const admin = await requireAdmin(event)
const adminId = admin._id.toString()
const alerts = await computeAllAlerts(adminId)
return { alerts }
})