From 0b7006a1caf9cf26c46b841bad35d0b42b68cd51 Mon Sep 17 00:00:00 2001 From: Amber Dev Date: Tue, 14 Jul 2020 19:08:47 +0530 Subject: [PATCH] solved bug regarding routing in CourseDetails.vue --- src/App.vue | 2 +- src/Services/GetApis.js | 1 - src/pages/Dashboard/CourseDetails.vue | 9 ++++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/App.vue b/src/App.vue index cbb37f0..5867324 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,7 +8,7 @@
- +
diff --git a/src/Services/GetApis.js b/src/Services/GetApis.js index 487e0f8..1c94173 100644 --- a/src/Services/GetApis.js +++ b/src/Services/GetApis.js @@ -33,7 +33,6 @@ export default { studentId: params.studentId }) this.courseData = response.data.data; - console.log("coursesData - ", this.courseData) } catch (error) { console.log("error in getStudentCourses - ", error.message) } diff --git a/src/pages/Dashboard/CourseDetails.vue b/src/pages/Dashboard/CourseDetails.vue index 6cd1a8d..5392e1d 100644 --- a/src/pages/Dashboard/CourseDetails.vue +++ b/src/pages/Dashboard/CourseDetails.vue @@ -148,9 +148,10 @@ export default { /* If the response is null then dont route */ if (response.data.data.length > 0) { - this.$router.push({ - name: "Course Details", - query: { courseId: courseId } + // REQUIRED TO WAIT FOR UPDATE CYCLE + this.$nextTick(() => { + // this.filters.locEmitted = "emitted"; + this.$router.push({ query: { courseId: courseId } }); }); } else { this.seeSnackbar("No Data Available", "warning"); @@ -158,11 +159,13 @@ export default { } }, async created() { + console.log("its working"); /* getParticularCourseDetail- To get courseDetail - defined in GetApis.js*/ let response = await this.getParticularCourseDetail( this.$route.query.courseId ); this.courseDetails = response.data.data; + console.log("its working courseDetails - ", this.courseDetails); /* getStudentCourses - to get courseData - defined in GetApis.js*/ await this.getStudentCourses({ -- 2.0.0