Skip to content
Snippets Groups Projects
Commit c8e10b49 authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Show selected timetable according to route parameters

parent 8b7a9d87
No related branches found
No related tags found
1 merge request!301New data model based on calendar events
Pipeline #147481 failed
......@@ -10,6 +10,21 @@ export default {
apollo: {
availableTimetables: {
query: gqlAvailableTimetables,
result() {
if (
!this.selected &&
this.$route.params.id &&
this.$route.params.type
) {
this.selectTimetable(
this.availableTimetables.find(
(t) =>
t.objId === this.$route.params.id &&
t.type.toLowerCase() === this.$route.params.type
)
);
}
},
},
},
data() {
......@@ -29,7 +44,7 @@ export default {
this.$router.push({ name: "chronos.timetable" });
} else if (
selected.objId !== this.$route.params.id ||
selected.type !== this.$route.params.type
selected.type.toLowerCase() !== this.$route.params.type
) {
this.$router.push({
name: "chronos.timetableWithId",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment