forked from Minecraft/Stonks
Filter stats where value = 0
parent
f1afe82492
commit
2ba00ab2c6
|
@ -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: [],
|
||||||
|
|
|
@ -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: [],
|
||||||
|
|
Loading…
Reference in New Issue