diff --git a/apps/studio/src/schemas/page.ts b/apps/studio/src/schemas/page.ts index 64fd19f186..a565809f0d 100644 --- a/apps/studio/src/schemas/page.ts +++ b/apps/studio/src/schemas/page.ts @@ -3,8 +3,7 @@ import { z } from "zod" const NEW_PAGE_LAYOUT_VALUES = [ "article", "content", -] satisfies PrismaJson.BlobJsonContent["layout"][] -type NewPageLayoutValues = (typeof NEW_PAGE_LAYOUT_VALUES)[number] +] as const satisfies readonly PrismaJson.BlobJsonContent["layout"][] export const MAX_TITLE_LENGTH = 150 export const MAX_PAGE_URL_LENGTH = 250 @@ -35,12 +34,7 @@ export const createPageSchema = z.object({ .max(MAX_PAGE_URL_LENGTH, { message: `Page URL should be shorter than ${MAX_PAGE_URL_LENGTH} characters.`, }), - layout: z - .enum< - string, - [NewPageLayoutValues] - >(NEW_PAGE_LAYOUT_VALUES as [NewPageLayoutValues]) - .default("content"), + layout: z.enum(NEW_PAGE_LAYOUT_VALUES).default("content"), siteId: z.number().min(1), // NOTE: implies that top level pages are allowed folderId: z.number().min(1).optional(),