mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
Dodano filtry do widoku historii rozkładów jazdy
This commit is contained in:
+7
-1
@@ -182,7 +182,13 @@ export const store = createStore<State>({
|
||||
async fetchTimetableData({ commit }) {
|
||||
|
||||
const reducedList = this.state.trainList.reduce(async (acc: Promise<Timetable[]>, train: Train) => {
|
||||
const timetable: TimetableAPIData = await (await axios.get(URLs.getTimetableURL(train.trainNo, this.state.region.id))).data.message;
|
||||
const data: { success: boolean; message: TimetableAPIData } = await (await axios.get(URLs.getTimetableURL(train.trainNo, this.state.region.id))).data;
|
||||
|
||||
if (!data.success) {
|
||||
return acc;
|
||||
}
|
||||
|
||||
const timetable = data.message;
|
||||
const trainInfo = timetable.trainInfo;
|
||||
|
||||
if (!timetable || !trainInfo) return acc;
|
||||
|
||||
Reference in New Issue
Block a user