You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: resources/vue/components/Stationboard.vue
+16-6Lines changed: 16 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,11 @@ export default {
15
15
type:String,
16
16
required:true,
17
17
default:"Karlsruhe Hbf"
18
+
},
19
+
stationId: {
20
+
type:Number,
21
+
required:true,
22
+
default:0
18
23
}
19
24
},
20
25
data() {
@@ -27,7 +32,8 @@ export default {
27
32
selectedTrain:null,
28
33
selectedDestination:null,
29
34
loading:false,
30
-
stationString:null,
35
+
stationName:null,
36
+
trwlStationId:null
31
37
};
32
38
},
33
39
methods: {
@@ -39,7 +45,8 @@ export default {
39
45
this.$refs.modal.show();
40
46
},
41
47
updateStation(station) {
42
-
this.stationString=station.name;
48
+
this.stationName=station.name;
49
+
this.trwlStationId=station.id;
43
50
this.data= [];
44
51
this.fetchData();
45
52
},
@@ -69,10 +76,9 @@ export default {
69
76
time =this.fetchTime.minus({minutes:5}).toString();
70
77
}
71
78
72
-
let query =this.stationString.replace(/%2F/, "").replace(/\//, "");
73
79
let travelType =this.travelType?this.travelType:"";
74
80
75
-
fetch(`/api/v1/trains/station/${query}/departures?when=${time}&travelType=${travelType}`)//TODO: change this to the new endpoint "/station/{id}/departures"
0 commit comments