import { fetchWowheadInfo } from '@/lib/wowhead-resolve' // Resuelve nombre, calidad e icono de una entidad de wowhead (rama WotLK) para que // el editor del foro pueda insertar el enlace ya con su nombre real, sin el parpadeo // de «item=xxx». La lógica vive en lib/wowhead-resolve (compartida con el render). export async function GET(request: Request) { const url = new URL(request.url) const type = String(url.searchParams.get('type') || 'item') const id = String(url.searchParams.get('id') || '') const locale = String(url.searchParams.get('locale') || 'es') const info = await fetchWowheadInfo(type, id, locale) if (!info) return Response.json({ name: null }, { status: 400 }) return Response.json(info) }