edit course - quiz fix

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-04 08:16:41 +08:00
parent 9e342f450d
commit 41e98bb602
@@ -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 {