File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
(pages)/judges/admin/_components/JudgeTeamGrouping Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -51,5 +51,7 @@ export default async function matchTeams() {
51
51
await createSubmission ( judge . _id , match . team_id . toString ( ) ) ;
52
52
}
53
53
}
54
+ } else {
55
+ return 'Failed to match teams: There may be fewer than two judge groups in one or more specialties.' ;
54
56
}
55
57
}
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ export default function matchingAlgorithm(
20
20
const matches : JudgeGroupToTeam [ ] = [ ] ;
21
21
22
22
for ( const team of filteredTeams ) {
23
- console . log ( team . name ) ;
24
23
teamAssignments . sort ( ( group1 , group2 ) => group1 . teams - group2 . teams ) ;
25
24
26
25
let pairedGroup = '' ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { useState } from 'react';
11
11
export default function JudgeTeamGrouping ( ) {
12
12
const [ trackResults , scoreAction ] = useFormState ( scoreTeams , null ) ;
13
13
const [ grouping , setGrouping ] = useState ( '' ) ;
14
+ const [ matching , setMatching ] = useState ( '' ) ;
14
15
15
16
return (
16
17
< div className = { styles . body } >
@@ -19,7 +20,11 @@ export default function JudgeTeamGrouping() {
19
20
>
20
21
Group Judges
21
22
</ 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 >
23
28
< button
24
29
onClick = { async ( ) => {
25
30
await deleteManyJudgeGroups ( ) ;
@@ -48,6 +53,7 @@ export default function JudgeTeamGrouping() {
48
53
: '' }
49
54
</ form >
50
55
< p > groups: { grouping } </ p >
56
+ < p > matching: { matching } </ p >
51
57
</ div >
52
58
) ;
53
59
}
You can’t perform that action at this time.
0 commit comments