mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-26 17:27:09 -05:00
23 lines
682 B
TypeScript
23 lines
682 B
TypeScript
import type { LoaderFunctionArgs } from "react-router";
|
|
import { z } from "zod";
|
|
import * as TournamentMatchRepository from "~/features/tournament-bracket/TournamentMatchRepository.server";
|
|
import { parseParams } from "~/utils/remix.server";
|
|
import { id } from "~/utils/zod";
|
|
import type { GetTournamentPlayersResponse } from "../schema";
|
|
|
|
const paramsSchema = z.object({
|
|
id,
|
|
});
|
|
|
|
export const loader = async ({ params }: LoaderFunctionArgs) => {
|
|
const { id } = parseParams({
|
|
params,
|
|
schema: paramsSchema,
|
|
});
|
|
|
|
const participants: GetTournamentPlayersResponse =
|
|
await TournamentMatchRepository.userParticipationByTournamentId(id);
|
|
|
|
return Response.json(participants);
|
|
};
|