feat: adding teams in PG

This commit is contained in:
Julien Froidefond
2025-08-21 09:44:29 +02:00
parent 4e82a6d860
commit 345ff5baa0
8 changed files with 478 additions and 14 deletions

View File

@@ -0,0 +1,21 @@
import { NextResponse } from "next/server";
import { TeamsService } from "@/services";
interface RouteParams {
params: {
direction: string;
};
}
export async function GET(request: Request, { params }: RouteParams) {
try {
const teams = await TeamsService.getTeamsByDirection(params.direction);
return NextResponse.json(teams);
} catch (error) {
console.error("Error loading teams by direction:", error);
return NextResponse.json(
{ error: "Failed to load teams by direction" },
{ status: 500 }
);
}
}