Nuxt 초기 세팅 추가
This commit is contained in:
34
server/utils/content-schema.js
Normal file
34
server/utils/content-schema.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const postStatusSchema = z.enum(['published', 'draft', 'private'])
|
||||
|
||||
export const postSchema = z.object({
|
||||
id: z.string().uuid(),
|
||||
title: z.string().min(1),
|
||||
slug: z.string().min(1),
|
||||
content: z.string(),
|
||||
excerpt: z.string().default(''),
|
||||
featuredImage: z.string().nullable().default(null),
|
||||
status: postStatusSchema,
|
||||
publishedAt: z.string().nullable().default(null),
|
||||
createdAt: z.string(),
|
||||
updatedAt: z.string(),
|
||||
tags: z.array(z.string()).default([])
|
||||
})
|
||||
|
||||
export const pageSchema = z.object({
|
||||
id: z.string().uuid(),
|
||||
title: z.string().min(1),
|
||||
slug: z.string().min(1),
|
||||
content: z.string(),
|
||||
featuredImage: z.string().nullable().default(null),
|
||||
createdAt: z.string(),
|
||||
updatedAt: z.string()
|
||||
})
|
||||
|
||||
export const tagSchema = z.object({
|
||||
id: z.string().uuid(),
|
||||
name: z.string().min(1),
|
||||
slug: z.string().min(1),
|
||||
description: z.string().default('')
|
||||
})
|
||||
Reference in New Issue
Block a user