03f75e189c
- /restore-character: recupera personajes borrados por BD (como .character deleted restore). Condiciones: nivel>60, borrado <30 días, DK no si ya hay DK activo, nombre libre, cooldown 12h/personaje. Gratis. Tabla home_restorehistory. - /restore-items: recupera ítems borrados vía SOAP del core (.item restore list / .item restore); el core aplica calidad/equipable/BoP/<7días. Cada ítem 100 PD (reembolso si SOAP falla), consulta con cooldown 8h/personaje + Turnstile. Tabla home_itemsearchhistory. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
18 lines
678 B
TypeScript
18 lines
678 B
TypeScript
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<string, unknown> = {}
|
|
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)))
|
|
}
|