Skip to content

Commit b9622cd

Browse files
authored
sorted teams by active/inactive (#342)
1 parent 6f84a11 commit b9622cd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/(pages)/admin/teams/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ export default function Teams() {
117117
<div className={styles.data_portion}>
118118
<div className={styles.teams_list}>
119119
{teamData
120-
.sort((a, b) => (b.reports?.length || 0) - (a.reports?.length || 0))
120+
.sort((a, b) => {
121+
if (a.active !== b.active) return b.active ? 1 : -1;
122+
return (b.reports?.length || 0) - (a.reports?.length || 0);
123+
})
121124
.map((team: TeamWithJudges) => (
122125
<div
123126
id={team._id}

0 commit comments

Comments
 (0)