fix(course): make coursesNo and reward description optional; render landing HTML safely
- Allow coursesNo to be omitted in instructor metadata (not required)
- Allow reward description to be omitted when reward object is present
- Replace raw {@html} with SafeHtmlContent in course-pricing,
course-info-blocks, and embed landing-page components
This commit is contained in:
@@ -285,7 +285,7 @@ export type TCourseCreate = z.infer<typeof ZCourseCreate>;
|
||||
|
||||
export const ZCourseReward = z.object({
|
||||
show: z.boolean(),
|
||||
description: z.string()
|
||||
description: z.string().optional()
|
||||
});
|
||||
|
||||
const METADATA_NULLABLE_STRING_KEYS = ['requirements', 'description', 'goals', 'videoUrl', 'paymentLink'] as const;
|
||||
@@ -320,7 +320,7 @@ function preprocessCourseMetadata(value: unknown): unknown {
|
||||
export const ZCourseInstructor = z.object({
|
||||
name: z.string(),
|
||||
role: z.string(),
|
||||
coursesNo: z.coerce.number(),
|
||||
coursesNo: z.coerce.number().optional(),
|
||||
description: z.string(),
|
||||
imgUrl: z.string()
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user