diff --git a/apps/cms/src/utilities/zodInteropt.ts b/apps/cms/src/utilities/zodInteropt.ts index 1c07fb92..08c5233a 100644 --- a/apps/cms/src/utilities/zodInteropt.ts +++ b/apps/cms/src/utilities/zodInteropt.ts @@ -26,7 +26,7 @@ function toPayloadZodField(name: string, zodType: z.ZodTypeAny): Field { ...field, type: "array", // convert nested type stored in array - fields: toPayloadZod((zodType as z.ZodArray).element), + fields: toPayloadZod((zodType as z.ZodArray>).element), }; } else if (typeName === "ZodNativeEnum") { return { @@ -36,7 +36,7 @@ function toPayloadZodField(name: string, zodType: z.ZodTypeAny): Field { // typescript encodes enums are encoded as bidirectional dictionary // with both entries from option -> value and value -> option // use zod parsing to select only the options -> value entries - options: Object.entries((zodType as z.ZodNativeEnum).enum) + options: Object.entries((zodType as z.ZodNativeEnum).enum) .filter(([_, right]) => zodType.safeParse(right).success) .map(([option, value]) => { return { label: option, value: `${value}` }; @@ -44,7 +44,7 @@ function toPayloadZodField(name: string, zodType: z.ZodTypeAny): Field { }; } else if (typeName === "ZodOptional") { return { - ...toPayloadZodField(name, (zodType as z.ZodOptional).unwrap()), + ...toPayloadZodField(name, (zodType as z.ZodOptional).unwrap()), // override nested field required true with false ...field, };