feat(admin-tags): POST /api/admin/tags to create craft/cooperative tags
Admin-only route that validates a label + pool via zod, slugifies the label, returns the existing tag if the slug already exists, otherwise creates a new active Tag document.
This commit is contained in:
parent
4a05e91715
commit
384d3197ce
2 changed files with 45 additions and 0 deletions
|
|
@ -383,6 +383,11 @@ export const tagSuggestionSchema = z.object({
|
|||
pool: z.enum(['craft', 'cooperative'])
|
||||
})
|
||||
|
||||
export const adminTagCreateSchema = z.object({
|
||||
label: z.string().trim().min(1).max(100),
|
||||
pool: z.enum(['craft', 'cooperative'])
|
||||
})
|
||||
|
||||
// --- Board post / channel schemas ---
|
||||
|
||||
export const boardPostCreateSchema = z.object({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue