'use server'; import { revalidatePath } from 'next/cache'; import { prisma } from '@/lib/prisma'; import { requireStaff } from '@/lib/admin/guard'; export async function deleteShout(formData: FormData): Promise { await requireStaff(); const raw = formData.get('id'); if (typeof raw !== 'string' || raw.trim() === '') return; let id: bigint; try { id = BigInt(raw); } catch { return; } try { await prisma.radioShouts.delete({ where: { id } }); } catch { // Row may already be gone; ignore so the action does not throw. } revalidatePath('/admin/radio'); }