add new content end game
All checks were successful
Gitea Auto Deploy / Deploy-Container (push) Successful in 2m2s

This commit is contained in:
2025-08-15 21:29:41 +07:00
parent f40a403ea2
commit 55f1415e2f
51 changed files with 67356 additions and 2765 deletions

View File

@@ -0,0 +1,18 @@
import { NextRequest, NextResponse } from 'next/server'
import { loadPeak } from '@/lib/loader'
export async function GET(
req: NextRequest,
{ params }: { params: Promise<{ id: string, locale: string }> }
) {
const { id, locale } = await params
const peakData = await loadPeak([id], locale)
const peak = peakData[id]
if (!peak) {
return NextResponse.json({ error: 'Peak info not found' }, { status: 404 })
}
return NextResponse.json(peak)
}

View File

@@ -0,0 +1,20 @@
import { loadPeak } from "@/lib/loader";
import { NextRequest, NextResponse } from "next/server";
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
try {
const body = await request.json();
const peakIds = body.peakIds as string[];
const { locale } = await params;
if (!Array.isArray(peakIds) || peakIds.some(id => typeof id !== 'string')) {
return NextResponse.json({ error: 'Invalid peakIds' }, { status: 400 });
}
const peakData = await loadPeak(peakIds, locale);
return NextResponse.json(peakData);
} catch {
return NextResponse.json({ error: 'Failed to load peak data' }, { status: 500 });
}
}