Skip to content

Commit

Permalink
Fix sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
CMEONE committed Oct 26, 2024
1 parent b860847 commit 2d6ee2b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion routers/api/scouting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,17 @@ router.post(
country: team.country,
state: team.state
};
}).sort((a: any, b: any) => parseInt(a.teamNumber) - parseInt(b.teamNumber))
}).sort((a: any, b: any) => {
let aTeamNumber = parseInt(a.teamNumber);
let bTeamNumber = parseInt(b.teamNumber);
if(isNaN(aTeamNumber)) {
aTeamNumber = 9999999;
}
if(isNaN(bTeamNumber)) {
bTeamNumber = 9999999;
}
return aTeamNumber - bTeamNumber;
})
}
};
} else {
Expand Down

0 comments on commit 2d6ee2b

Please sign in to comment.