mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-30 15:17:43 -05:00
Add logging to check in/out
This commit is contained in:
@@ -38,6 +38,7 @@ import { tournamentIdFromParams } from "../tournament-utils";
|
||||
import { useTournament } from "./to.$id";
|
||||
import { findMapPoolByTeamId } from "~/features/tournament-bracket/queries/findMapPoolByTeamId.server";
|
||||
import { Input } from "~/components/Input";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
export const action: ActionFunction = async ({ request, params }) => {
|
||||
const user = await requireUserId(request);
|
||||
@@ -162,6 +163,9 @@ export const action: ActionFunction = async ({ request, params }) => {
|
||||
// 0 = regular check in
|
||||
bracketIdx: data.bracketIdx === 0 ? null : data.bracketIdx,
|
||||
});
|
||||
logger.info(
|
||||
`Checked out: tournament team id: ${data.teamId} - user id: ${user.id} - tournament id: ${tournamentId} - bracket idx: ${data.bracketIdx}`,
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "REMOVE_MEMBER": {
|
||||
|
||||
@@ -78,6 +78,7 @@ import { findMapPoolByTeamId } from "~/features/tournament-bracket/queries/findM
|
||||
import { filterOutFalsy } from "~/utils/arrays";
|
||||
import { MapPoolStages } from "~/components/MapPoolSelector";
|
||||
import { Section } from "~/components/Section";
|
||||
import { logger } from "~/utils/logger";
|
||||
|
||||
export const action: ActionFunction = async ({ request, params }) => {
|
||||
const user = await requireUser(request);
|
||||
@@ -186,6 +187,10 @@ export const action: ActionFunction = async ({ request, params }) => {
|
||||
break;
|
||||
}
|
||||
case "CHECK_IN": {
|
||||
logger.info(
|
||||
`Checking in (try): tournament team id: ${ownTeam?.id} - user id: ${user.id} - tournament id: ${tournamentId}`,
|
||||
);
|
||||
|
||||
validate(tournament.regularCheckInIsOpen, "Check in is not open");
|
||||
validate(ownTeam);
|
||||
validate(!ownTeamCheckedIn, "You have already checked in");
|
||||
@@ -197,6 +202,9 @@ export const action: ActionFunction = async ({ request, params }) => {
|
||||
);
|
||||
|
||||
checkIn(ownTeam.id);
|
||||
logger.info(
|
||||
`Checking in (success): tournament team id: ${ownTeam.id} - user id: ${user.id} - tournament id: ${tournamentId}`,
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "ADD_PLAYER": {
|
||||
|
||||
Reference in New Issue
Block a user