Yaltopia-FIFA/app/api/matches/[matchId]/route.ts
Kirubel-Kibru-Yaltopia 89440985f1
Some checks failed
Deploy to Cloudflare Workers / deploy (push) Has been cancelled
x
2026-05-24 21:46:10 +03:00

20 lines
599 B
TypeScript

import { createClient } from "@/lib/supabase/server";
import { requireUser } from "@/lib/api/auth";
import { apiError, apiSuccess } from "@/lib/api/errors";
import * as matches from "@/lib/services/matches";
export async function GET(
_request: Request,
{ params }: { params: Promise<{ matchId: string }> }
) {
try {
const { matchId } = await params;
const supabase = await createClient();
await requireUser(supabase);
const data = await matches.getMatchDetails(supabase, matchId);
return apiSuccess(data);
} catch (e) {
return apiError(e);
}
}