Refactor API clients and update project structure for TimeToLeave

This commit is contained in:
2026-05-10 01:47:22 +02:00
parent 7c345785a7
commit a7fcbd811e
23 changed files with 12680 additions and 1181 deletions
+2 -2
View File
@@ -61,7 +61,7 @@ function parseHafasJourneys(json: unknown, hafasDate: string, queryDate: Date):
});
}
export function useJourneys(fromStationExtId: string | null, toStationExtId: string | null, date: Date) {
export function useJourneys(fromStationExtId: string | null, toStationExtId: string | null, date: Date, refreshKey = 0) {
const [journeys, setJourneys] = useState<Journey[]>([]);
const [loading, setLoading] = useState<boolean>(false);
const [error, setError] = useState<string | null>(null);
@@ -127,7 +127,7 @@ export function useJourneys(fromStationExtId: string | null, toStationExtId: str
return () => {
isMounted = false;
};
}, [fromStationExtId, toStationExtId, date]);
}, [fromStationExtId, toStationExtId, date, refreshKey]);
return { journeys, loading, error };
}