Fix materials not adding
This commit is contained in:
@@ -70,14 +70,14 @@
|
||||
badgeValue = !!note ? 1 : 0;
|
||||
} else {
|
||||
badgeValue =
|
||||
typeof video_url === 'string' ? video_url.split(',').length : 0;
|
||||
typeof video_url === 'string' && !!video_url
|
||||
? video_url.split(',').length
|
||||
: 0;
|
||||
}
|
||||
|
||||
tab.badgeValue = badgeValue;
|
||||
return tab;
|
||||
});
|
||||
|
||||
console.log(`tabs`, tabs);
|
||||
}
|
||||
|
||||
$: handleSave(prevMode);
|
||||
@@ -138,7 +138,7 @@
|
||||
bind:value={$lesson.materials.video_url}
|
||||
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}
|
||||
<div class="mb-5">
|
||||
<iframe
|
||||
|
||||
@@ -86,5 +86,11 @@ export async function handleSaveLesson(lesson, course_id) {
|
||||
}
|
||||
|
||||
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