Sort player stats by rank, then value
parent
7c637f181e
commit
c3286bfa7f
|
@ -20,7 +20,7 @@ const Player = ({ playerId, players }) => {
|
||||||
`player ${playerId}`,
|
`player ${playerId}`,
|
||||||
async () => {
|
async () => {
|
||||||
const { data } = await axios.get(`/api/players/${playerId}`);
|
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);
|
return data.filter((x) => x.value > 0);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue