Small fixes & fmt
This commit is contained in:
parent
6b12e21d50
commit
f32a552f46
23 changed files with 347 additions and 99 deletions
|
|
@ -30,8 +30,12 @@ export function useTravelDestinations(mode: TransportMode) {
|
|||
return res.json();
|
||||
})
|
||||
.then((data: { destinations: Destination[] }) => {
|
||||
cacheRef.current[mode] = data.destinations;
|
||||
setDestinations(data.destinations);
|
||||
const normalized = data.destinations.map((d) => ({
|
||||
...d,
|
||||
city: d.city === 'City of London' ? 'London' : d.city,
|
||||
}));
|
||||
cacheRef.current[mode] = normalized;
|
||||
setDestinations(normalized);
|
||||
})
|
||||
.catch((err) => logNonAbortError('travel destinations', err))
|
||||
.finally(() => setLoading(false));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue