Filter stats where value = 0

main
Kevin Belisle 2021-07-21 15:53:40 -04:00
parent f1afe82492
commit 2ba00ab2c6
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ const Player = ({ playerId, players }) => {
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);
return data; return data.filter((x) => x.value > 0);
}, },
{ {
placeholderData: [], placeholderData: [],

View File

@ -19,7 +19,7 @@ const Statistic = ({ type, name, players }) => {
`statistic ${type} ${name}`, `statistic ${type} ${name}`,
async () => { async () => {
const { data } = await axios.get(`/api/statistics/${type}/${name}`); const { data } = await axios.get(`/api/statistics/${type}/${name}`);
return data; return data.filter((x) => x.value > 0);
}, },
{ {
placeholderData: [], placeholderData: [],