Some checks failed
Gitea Auto Deploy / Deploy-Container (push) Failing after 1m36s
19 lines
464 B
TypeScript
19 lines
464 B
TypeScript
import { NextRequest, NextResponse } from 'next/server'
|
|
import { loadRelics } from '@/lib/loader'
|
|
|
|
export async function GET(
|
|
req: NextRequest,
|
|
{ params }: { params: Promise<{ id: string, locale: string }> }
|
|
) {
|
|
|
|
const { id, locale } = await params
|
|
const relics = await loadRelics([id], locale)
|
|
const relic = relics[id]
|
|
|
|
if (!relic) {
|
|
return NextResponse.json({ error: 'Relic not found' }, { status: 404 })
|
|
}
|
|
|
|
return NextResponse.json(relic)
|
|
}
|