-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EQM: On first save, update the quiz's ID when redirecting #12283
Changes from 1 commit
343522a
c24f038
8b83761
7f4614c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,16 +174,16 @@ | |
}, | ||
}); | ||
} else { | ||
if (this.$route.params.quizId === exam.id) { | ||
return; | ||
} | ||
this.$router.replace({ | ||
name: PageNames.EXAM_CREATION_ROOT, | ||
params: { | ||
classId: this.$route.params.classId, | ||
quizId: exam.id, | ||
}, | ||
}); | ||
// Update the quiz with the new id - there won't be if this is a new quiz, | ||
// this ensures the quiz is kept up-to-date since we're replacing the route | ||
this.updateQuiz({ id: exam.id }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems right - although maybe this should live inside the useQuizCreation composable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried putting it at the end of saveQuiz but it wasn't working so I tried this... I think that maybe the issue was that I wasn't returning the exam in the |
||
} | ||
}) | ||
.catch(error => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should remove this - but we should coerce them both to strings for the comparison because for draft exams the exam.id will be an integer, but the route parameter will be a string.
When I did a subsequent save, not having this here led me to get a redundant navigation error from the replace below.