import { getSession } from '@/lib/session' import { restoreItem } from '@/lib/restore-items' /** Restaura un ítem borrado (cuesta 100 PD). */ export async function POST(request: Request) { const session = await getSession() if (!session.accountId || !session.username) { return Response.json({ success: false, error: 'notAuthenticated' }, { status: 401 }) } let body: Record = {} try { body = await request.json() } catch { return Response.json({ success: false, error: 'invalidRequest' }, { status: 400 }) } return Response.json(await restoreItem(session.accountId, String(body.character ?? '').trim(), Number(body.recoverId))) }