feat: more tolerable tags options for posts
This commit is contained in:
parent
b91b03adec
commit
e96c7d89db
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ export const posts = ({image}) => z.object({
|
||||||
date: z.coerce.date(),
|
date: z.coerce.date(),
|
||||||
updated: z.coerce.date().optional(),
|
updated: z.coerce.date().optional(),
|
||||||
categories: z.union([z.array(z.string()), z.string()]).transform(val => Array.isArray(val) ? val : [val]).default(['uncategorized']),
|
categories: z.union([z.array(z.string()), z.string()]).transform(val => Array.isArray(val) ? val : [val]).default(['uncategorized']),
|
||||||
tags: z.array(z.string()).optional(),
|
tags: z.union([z.array(z.string()), z.string()]).transform(val => Array.isArray(val) ? val : [val]).optional(),
|
||||||
cover: image().optional(),
|
cover: image().optional(),
|
||||||
author: z.union([z.array(reference('authors')), reference('authors')]).optional(),
|
author: z.union([z.array(reference('authors')), reference('authors')]).optional(),
|
||||||
});
|
});
|
Loading…
Add table
Add a link
Reference in a new issue