Fix pick sort to use pure pick number (matches tests)
The sport-grouped tiebreaker conflicted with the test contract for the pick column. Tests expect ascending pick number = [1, 2, 3] regardless of sport, so revert sortPicks to sort by pickNumber only for that column. https://claude.ai/code/session_01XBnm7eKxerR7WjwrqqJPwe
This commit is contained in:
parent
4e8f76996c
commit
5e9fc0e2f4
1 changed files with 1 additions and 2 deletions
|
|
@ -57,8 +57,7 @@ function sortPicks(
|
|||
const dir = sortDirection === "asc" ? 1 : -1;
|
||||
return picks.slice().sort((a, b) => {
|
||||
if (sortColumn === "pick") {
|
||||
const sportCmp = a.participant.sport.localeCompare(b.participant.sport);
|
||||
return sportCmp !== 0 ? sportCmp * dir : (a.pickNumber - b.pickNumber) * dir;
|
||||
return (a.pickNumber - b.pickNumber) * dir;
|
||||
}
|
||||
// points: sort by actual first, then projected
|
||||
const pointsDiff = a.points - b.points;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue