Skip to content

Commit 3870abc

Browse files
committed
add locked to lessons
1 parent 7ebc4b0 commit 3870abc

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎apps/codingcatdev/src/lib/server/content.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ContentType, ContentPublished } from '$lib/types';
1+
import { ContentType, ContentPublished, type Lesson } from '$lib/types';
22
import type { Content, Course } from '$lib/types';
33

44
const LIMIT = 20;
@@ -65,7 +65,7 @@ export const parseLessonModules = async ({ lessonModules, courses }: { lessonMod
6565
default: {
6666
render: () => { html: string };
6767
};
68-
metadata: Content;
68+
metadata: Lesson;
6969
};
7070
const { html } = mdsvx.default.render();
7171
/**
@@ -81,7 +81,8 @@ export const parseLessonModules = async ({ lessonModules, courses }: { lessonMod
8181
html,
8282
weight: mdsvx?.metadata?.weight ? mdsvx?.metadata?.weight : 0,
8383
published: mdsvx?.metadata?.published ? mdsvx?.metadata?.published : 'draft',
84-
start: mdsvx?.metadata?.start ? new Date(mdsvx?.metadata?.start) : new Date('Jan 01, 1900')
84+
start: mdsvx?.metadata?.start ? new Date(mdsvx?.metadata?.start) : new Date('Jan 01, 1900'),
85+
locked: mdsvx?.metadata?.locked || false,
8586
};
8687

8788
courses

‎apps/codingcatdev/src/lib/types/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface Lesson extends Content {
2424
courseSlug?: string;
2525
lesson?: Lesson[];
2626
section?: string;
27+
locked: boolean;
2728
}
2829
export interface Podcast extends Content {
2930
season?: number;

0 commit comments

Comments
 (0)