fix: fields from Contentstack can be null.

This commit is contained in:
Michael Zetterberg
2024-10-14 14:31:08 +02:00
parent 0a46643155
commit 8ec1707fd5

View File

@@ -13,7 +13,7 @@ export const shortcutsSchema = z.object({
.object({
subtitle: z.string().nullable(),
title: z.string().nullable(),
two_column_list: z.boolean().default(false),
two_column_list: z.boolean().nullable().default(false),
shortcuts: z
.array(
z.object({
@@ -57,7 +57,7 @@ export const shortcutsSchema = z.object({
.transform(({ two_column_list, ...rest }) => {
return {
...rest,
hasTwoColumns: two_column_list,
hasTwoColumns: !!two_column_list,
}
}),
})