From 18c917416a3947330c82e876eb0bd10213a484ec Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Fri, 1 Sep 2023 16:50:47 -0500 Subject: [PATCH] Internal: Use cid from CourseHome param - refs BT#20933 --- assets/vue/router/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/vue/router/index.js b/assets/vue/router/index.js index aa1989704c..64ec63016b 100644 --- a/assets/vue/router/index.js +++ b/assets/vue/router/index.js @@ -165,9 +165,13 @@ router.beforeEach((to, from, next) => { router.beforeResolve(async (to) => { const cidReqStore = useCidReqStore() - const cid = parseInt(to.query?.cid ?? 0) + let cid = parseInt(to.query?.cid ?? 0) const sid = parseInt(to.query?.sid ?? 0) + if ("CourseHome" === to.name) { + cid = parseInt(to.params?.id ?? 0) + } + if (cid) { await cidReqStore.setCourseAndSessionById(cid, sid) } else {