mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
edit course - quiz fix
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -393,7 +393,10 @@ export default function ModifyQuiz() {
|
||||
|
||||
if (!quizId) {
|
||||
const res = await createQuiz(courseId, unitId, meta);
|
||||
quizId = res?.data?.data?.data?.quiz_id;
|
||||
// res is the raw response body: { status, message, data: { data: quiz } }
|
||||
// (createQuiz() itself unwraps the same object as data?.data?.data to get
|
||||
// the quiz row — this needs the same two levels, not three).
|
||||
quizId = res?.data?.data?.quiz_id;
|
||||
if (!quizId) return;
|
||||
setLocalQuiz((prev) => ({ ...prev, quiz_id: quizId }));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user