Skip to content

Commit

Permalink
refactor: ♻️ cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
CourtHive committed Apr 2, 2024
1 parent 0bf3fb6 commit ec373ef
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/assemblies/generators/tournamentRecords/generateStatCrew.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,18 @@ export function generateStatCrew(params) {
if (paramsCheck.error) return paramsCheck;

const { tournamentRecord } = params;
const { tournamentId } = tournamentRecord;
const { startDate, tournamentId } = tournamentRecord;

const teamParticipants = tournamentRecord.participants.filter((participant) => participant.participantType === TEAM);

const homeTeam = teamParticipants?.find((team) => team.participantRoleResponsibilities?.includes('Home'));
const awayTeams = teamParticipants?.filter((team) => team.participantId !== homeTeam?.participantId);
const date = formatDate(startDate, '/', 'MDY');
const neutralGame = !homeTeam ? 'Y' : 'N';
const date = formatDate(tournamentRecord.startDate, '/', 'MDY');

const visname = awayTeams?.[0]?.participantName;
const visid = awayTeams?.[0]?.participantId;

const homename = homeTeam?.participantName || awayTeams?.[1]?.participantName;
const homeid = homeTeam?.participantId || awayTeams?.[1]?.participantId;
const visname = awayTeams?.[0]?.participantName;
const visid = awayTeams?.[0]?.participantId;

const matchUps = allTournamentMatchUps({ tournamentRecord }).matchUps;
const singles = matchUps?.filter((matchUp) => matchUp.matchUpType === SINGLES);
Expand Down

0 comments on commit ec373ef

Please sign in to comment.