Fix materials not adding
This commit is contained in:
@@ -70,14 +70,14 @@
|
|||||||
badgeValue = !!note ? 1 : 0;
|
badgeValue = !!note ? 1 : 0;
|
||||||
} else {
|
} else {
|
||||||
badgeValue =
|
badgeValue =
|
||||||
typeof video_url === 'string' ? video_url.split(',').length : 0;
|
typeof video_url === 'string' && !!video_url
|
||||||
|
? video_url.split(',').length
|
||||||
|
: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
tab.badgeValue = badgeValue;
|
tab.badgeValue = badgeValue;
|
||||||
return tab;
|
return tab;
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`tabs`, tabs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$: handleSave(prevMode);
|
$: handleSave(prevMode);
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
bind:value={$lesson.materials.video_url}
|
bind:value={$lesson.materials.video_url}
|
||||||
onChange={() => ($isLessonDirty = true)}
|
onChange={() => ($isLessonDirty = true)}
|
||||||
/>
|
/>
|
||||||
{:else if $lesson.materials.video_url && $lesson.materials.video_url.includes('youtube')}
|
{:else if !!$lesson.materials.video_url && $lesson.materials.video_url.includes('youtube')}
|
||||||
{#each $lesson.materials.video_url.split(',') as url}
|
{#each $lesson.materials.video_url.split(',') as url}
|
||||||
<div class="mb-5">
|
<div class="mb-5">
|
||||||
<iframe
|
<iframe
|
||||||
|
|||||||
@@ -86,5 +86,11 @@ export async function handleSaveLesson(lesson, course_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function handleUpdateLessonMaterials(lesson, lessonId) {
|
export async function handleUpdateLessonMaterials(lesson, lessonId) {
|
||||||
return await updateLesson(lesson.materials, lessonId);
|
const materials = {
|
||||||
|
...lesson.materials,
|
||||||
|
};
|
||||||
|
|
||||||
|
delete materials.totalExercises;
|
||||||
|
|
||||||
|
return await updateLesson(materials, lessonId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user