Skip to content

Commit

Permalink
fix typecheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
zefanjajobse committed Sep 16, 2024
1 parent f6113bf commit b9bdddd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/api/GametoolsApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export interface managerPlayers {
bfban: { [name: string]: bfbanPlayers };
bfeac: number[];
}
name;

export interface bfbanPlayer {
apiUrl: string;
Expand Down
9 changes: 3 additions & 6 deletions src/components/routes/Servers/Detailed/Leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export function ServerLeaderboard(
});

const players = stats?.data;
let playerIds: string[] = [];
let playerIds: number[] = [];
playerIds = playerIds.concat(
players?.map((player) => {
return player?.playerId?.toString();
return player?.playerId;
}),
);

Expand All @@ -51,10 +51,7 @@ export function ServerLeaderboard(
data: checkBanInfo,
} = useQuery({
queryKey: ["managerCheckPlayers" + playerIds + "leaderboard"],
queryFn: () =>
GametoolsApi.managerCheckPlayers({
playerIds: playerIds.map(Number),
}),
queryFn: () => GametoolsApi.managerCheckPlayers({ playerIds }),
});

if (loading || error) {
Expand Down
9 changes: 3 additions & 6 deletions src/components/routes/Servers/Detailed/Players.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ function Players(props: {
const [copyState, setCopyState] = React.useState<string>("");
const [adminMode] = useLocalStorage<boolean>("adminMode", false);

let playerIds = [];
let playerIds: number[] = [];
teams.forEach((teamInfo: serverTeamList) => {
playerIds = playerIds.concat(
teamInfo.players.map((player) => {
return player?.player_id?.toString();
return player?.player_id;
}),
);
});
Expand All @@ -51,10 +51,7 @@ function Players(props: {
data: checkBanInfo,
} = useQuery({
queryKey: ["managerCheckPlayers" + playerIds],
queryFn: () =>
GametoolsApi.managerCheckPlayers({
playerIds: playerIds.map(Number),
}),
queryFn: () => GametoolsApi.managerCheckPlayers({ playerIds }),
});

let update_timestamp = new Date();
Expand Down

0 comments on commit b9bdddd

Please sign in to comment.