feat(admin): add GET /api/admin/alerts endpoint
This commit is contained in:
parent
4f7a11bcf3
commit
f0284c60b4
2 changed files with 97 additions and 0 deletions
8
server/api/admin/alerts/index.get.js
Normal file
8
server/api/admin/alerts/index.get.js
Normal 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 }
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue