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:
Rotimi Best
2026-06-16 02:57:23 +01:00
parent 38d912a0b1
commit 2350315321
4 changed files with 14 additions and 11 deletions
@@ -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()
});