locale second stage
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import type { NextRequest } from "next/server";
|
||||
import { fetchMatchesAndTeams, fetchOdds, attachOdds, attachKOOdds, fetchFifaScores, applyFifaScores, assignKONumbersBySlots, attachFifaGoals } from "@/lib/feeds";
|
||||
import { computeGroupTables, computeThirdPlaceTable } from "@/lib/standings";
|
||||
import { qualifiedThirdGroups, resolveAnnexC } from "@/lib/bracket";
|
||||
@@ -8,7 +9,8 @@ import { securelyQualifiedThirdTeams } from "@/lib/third-place-security";
|
||||
// Upstream-Feeds berührt — gecacht, damit Rate Limits eingehalten werden.
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function GET() {
|
||||
export async function GET(request: NextRequest) {
|
||||
const locale = request.nextUrl.searchParams.get("locale") || "de";
|
||||
try {
|
||||
const { matches: rawMatches, teams } = await fetchMatchesAndTeams();
|
||||
|
||||
@@ -30,10 +32,10 @@ export async function GET() {
|
||||
}
|
||||
|
||||
try {
|
||||
const fifaData = await fetchFifaScores();
|
||||
const fifaData = await fetchFifaScores(locale);
|
||||
matches = applyFifaScores(matches, teams, fifaData);
|
||||
try {
|
||||
matches = await attachFifaGoals(matches, fifaData);
|
||||
matches = await attachFifaGoals(matches, fifaData, locale);
|
||||
} catch (err) {
|
||||
console.warn("[fifa] Goals fehlgeschlagen:", err instanceof Error ? err.message : err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user