fix: empty lesson title bug (#314)
* finished the lesson title bug * made chnages based on review * Update +page.svelte --------- Co-authored-by: Rotimi Best <[email protected]>
This commit is contained in:
@@ -4,6 +4,7 @@ import { createLesson, updateLesson, deleteLesson } from '$lib/utils/services/co
|
||||
import type { Lesson, Course, LessonPage, LessonComment } from '$lib/utils/types';
|
||||
import { LOCALE } from '$lib/utils/types';
|
||||
import { snackbar } from '$lib/components/Snackbar/store';
|
||||
import { lessonValidation } from '$lib/utils/functions/validator';
|
||||
|
||||
export const uploadCourseVideoStore = writable({
|
||||
isModalOpen: false
|
||||
@@ -68,6 +69,12 @@ export async function handleDelete(lessonId: Lesson['id'] | undefined) {
|
||||
}
|
||||
|
||||
export async function handleSaveLesson(lesson: Lesson, course_id: Course['id']) {
|
||||
const result = lessonValidation(lesson);
|
||||
|
||||
if (Object.keys(result).length) {
|
||||
return result;
|
||||
}
|
||||
|
||||
console.log(`handleSaveLesson lesson`, lesson);
|
||||
const newLesson = {
|
||||
title: lesson.title,
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
size="sm"
|
||||
shape="rounded-full"
|
||||
/>
|
||||
<span>{item.title}</span>
|
||||
<span class="w-[70%] text-ellipsis line-clamp-2">{item.title}</span>
|
||||
<span class="grow" />
|
||||
{#if !item.is_unlocked}
|
||||
<span class="text-md ml-2" title="This lesson is locked.">
|
||||
|
||||
Reference in New Issue
Block a user