diff --git a/frontend/components/Dashboard/CourseCard.tsx b/frontend/components/Dashboard/CourseCard.tsx
index 7a5a11ffd..f36c9cea4 100644
--- a/frontend/components/Dashboard/CourseCard.tsx
+++ b/frontend/components/Dashboard/CourseCard.tsx
@@ -239,6 +239,7 @@ const CourseCard = ({ course, loading, isNew }: CourseCardProps) => {
<>
}
@@ -247,6 +248,7 @@ const CourseCard = ({ course, loading, isNew }: CourseCardProps) => {
{
)}
{isNew && (
{
.required(t("courseTeacherEmailRequired")),
support_email: Yup.string().email(t("courseEmailInvalid")),
start_date: Yup.mixed()
+ .nullable()
.typeError(t("courseStartDateRequired"))
.required(t("courseStartDateRequired"))
.transform((datetime?: string | DateTime) => {
@@ -124,6 +125,7 @@ const courseEditSchema = ({ client, initialSlug, t }: CourseEditSchemaArgs) => {
},
),
end_date: Yup.mixed()
+ .nullable()
.test(
"end_invalid",
t("invalidDate"),
@@ -234,9 +236,10 @@ const courseEditSchema = ({ client, initialSlug, t }: CourseEditSchemaArgs) => {
})
}
-export type CourseEditSchemaType = Yup.InferType<
- ReturnType
->
+export type CourseEditSchemaType = Omit<
+ Yup.InferType>,
+ "start_date"
+> & { start_date: DateTime | null } // help typescript a bit, even if we don't really allow null
interface ValidateSlugArgs {
client: ApolloClient