import { NextRequest, NextResponse } from 'next/server' import { listNotificationCenterAudits } from '@/lib/notification-center-admin' import { requireNotificationCenterSuperAdmin, toNotificationCenterAdminErrorResponse, } from '../_shared' export const runtime = 'nodejs' export const dynamic = 'force-dynamic' export async function GET(request: NextRequest) { try { const auth = await requireNotificationCenterSuperAdmin() if ('response' in auth) return auth.response const result = await listNotificationCenterAudits(auth.actor, new URL(request.url).searchParams) return NextResponse.json({ success: true, data: result.data }, { status: result.status }) } catch (error) { return toNotificationCenterAdminErrorResponse(error) } }