mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-22 23:21:52 -05:00
Filter teams who missed checked in Closes #804
This commit is contained in:
parent
799725aa2d
commit
ceaa6192a9
|
|
@ -6,7 +6,10 @@ import * as Tournament from "~/models/Tournament.server";
|
|||
import * as TournamentTeam from "~/models/TournamentTeam.server";
|
||||
import { Serialized, Unpacked } from "~/utils";
|
||||
import { db } from "~/utils/db.server";
|
||||
import { isTournamentAdmin } from "~/core/tournament/validators";
|
||||
import {
|
||||
isTournamentAdmin,
|
||||
tournamentHasNotStarted,
|
||||
} from "~/core/tournament/validators";
|
||||
|
||||
export type FindTournamentByNameForUrlI = Serialized<
|
||||
Prisma.PromiseReturnType<typeof findTournamentByNameForUrl>
|
||||
|
|
@ -26,7 +29,9 @@ export async function findTournamentByNameForUrl({
|
|||
|
||||
if (!result) throw new Response("No tournament found", { status: 404 });
|
||||
|
||||
result.teams.sort(sortTeamsBySeed(result.seeds));
|
||||
result.teams = result.teams
|
||||
.sort(sortTeamsBySeed(result.seeds))
|
||||
.filter((team) => team.checkedInTime || tournamentHasNotStarted(result));
|
||||
|
||||
result.organizer.twitter = twitterToUrl(result.organizer.twitter);
|
||||
result.organizer.discordInvite = discordInviteToUrl(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user