import { getSession } from '@/lib/session'
import { isAdmin } from '@/lib/admin'
import { deleteGoldOption } from '@/lib/admin-gold'

export async function DELETE(_request: Request, { params }: { params: Promise<{ id: string }> }) {
  const session = await getSession()
  if (!(await isAdmin(session))) return Response.json({ success: false, error: 'forbidden' }, { status: 403 })
  const { id } = await params
  await deleteGoldOption(Number(id))
  return Response.json({ success: true })
}
