Sort player stats by rank, then value

main
Kevin Belisle 2021-09-03 11:46:59 -04:00
parent 7c637f181e
commit c3286bfa7f
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ const Player = ({ playerId, players }) => {
`player ${playerId}`,
async () => {
const { data } = await axios.get(`/api/players/${playerId}`);
data.sort((a, b) => a.rank - b.rank);
data.sort((a, b) => a.rank - b.rank || b.value - a.value);
return data.filter((x) => x.value > 0);
},
{