Skip to content

Commit

Permalink
quizsummarypage fetch quiz in created, not route hook
Browse files Browse the repository at this point in the history
  • Loading branch information
nucleogenesis committed Aug 26, 2024
1 parent 458358c commit 4a89d8f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@
return this.$route.params.classId;
},
},
beforeRouteEnter(to, from, next) {
return fetchQuizSummaryPageData(to.params.quizId)
created() {
return fetchQuizSummaryPageData(this.$route.params.quizId)
.then(data => {
next(vm => vm.setData(data));
this.setData(data);
})
.catch(error => {
next(vm => vm.setError(error));
this.setError(error);
});
},
methods: {
Expand Down Expand Up @@ -240,7 +240,7 @@
});
},
handleSubmitDelete() {
return deleteExam(this.quiz.id)
return deleteExam(this.$route.params.quizId)
.then(() => {
this.$store.commit('classSummary/DELETE_ITEM', { map: 'examMap', id: this.quiz.id });
this.$router.replace(this.$router.getRoute('EXAMS'), () => {
Expand Down

0 comments on commit 4a89d8f

Please sign in to comment.