This commit is contained in:
@@ -6,5 +6,18 @@ export const createArticleSchema = z.object({
|
||||
|
||||
export const updateArticleSchema = z.object({
|
||||
title: z.string().min(1).max(256),
|
||||
content: z.string().max(50000)
|
||||
slug: z.string().min(1).max(120),
|
||||
content: z.string().max(50000),
|
||||
tags: z.array(z.string().min(1).max(32)).max(8)
|
||||
});
|
||||
|
||||
export function parseArticleTags(value: string) {
|
||||
return [
|
||||
...new Set(
|
||||
value
|
||||
.split(',')
|
||||
.map((tag) => tag.trim().toLowerCase())
|
||||
.filter(Boolean)
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user