On récupère pour l'instant tous les trains sans se préoccuper de la pagination

This commit is contained in:
Emmy D'Anello 2024-12-12 15:49:38 +01:00
parent bfc6069a87
commit e623dad81f
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -40,7 +40,7 @@ export default function GameProvider({ children }: { children: ReactNode }) {
const trainsQuery = useQuery({
queryKey: ['get-trains', game.playerId, auth.token],
queryFn: () => fetch(`${process.env.EXPO_PUBLIC_TRAINTRAPE_MOI_SERVER}/trains/?playerId=${game.playerId}`, {
queryFn: () => fetch(`${process.env.EXPO_PUBLIC_TRAINTRAPE_MOI_SERVER}/trains/?playerId=${game.playerId}&size=10000`, {
headers: { "Authorization": `Bearer ${auth.token}` }}
).then(resp => resp.json()),
enabled: isAuthValid(auth) && !game.playerId,