Skip to content

Commit 3a39077

Browse files
committed
Updated error message
1 parent 62b266c commit 3a39077

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

app/(api)/_actions/logic/matchTeams.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,7 @@ export default async function matchTeams() {
5151
await createSubmission(judge._id, match.team_id.toString());
5252
}
5353
}
54+
} else {
55+
return 'Failed to match teams: There may be fewer than two judge groups in one or more specialties.';
5456
}
5557
}

app/(api)/_utils/grouping/matchingAlgorithm.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export default function matchingAlgorithm(
2020
const matches: JudgeGroupToTeam[] = [];
2121

2222
for (const team of filteredTeams) {
23-
console.log(team.name);
2423
teamAssignments.sort((group1, group2) => group1.teams - group2.teams);
2524

2625
let pairedGroup = '';

app/(pages)/judges/admin/_components/JudgeTeamGrouping/JudgeTeamGrouping.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { useState } from 'react';
1111
export default function JudgeTeamGrouping() {
1212
const [trackResults, scoreAction] = useFormState(scoreTeams, null);
1313
const [grouping, setGrouping] = useState('');
14+
const [matching, setMatching] = useState('');
1415

1516
return (
1617
<div className={styles.body}>
@@ -19,7 +20,11 @@ export default function JudgeTeamGrouping() {
1920
>
2021
Group Judges
2122
</button>
22-
<button onClick={async () => await matchTeams()}>Match Teams</button>
23+
<button
24+
onClick={async () => setMatching(JSON.stringify(await matchTeams()))}
25+
>
26+
Match Teams
27+
</button>
2328
<button
2429
onClick={async () => {
2530
await deleteManyJudgeGroups();
@@ -48,6 +53,7 @@ export default function JudgeTeamGrouping() {
4853
: ''}
4954
</form>
5055
<p>groups: {grouping}</p>
56+
<p>matching: {matching}</p>
5157
</div>
5258
);
5359
}

0 commit comments

Comments
 (0)