added tons of features

This commit is contained in:
2025-02-05 08:01:14 +02:00
parent 4ae0d8c545
commit 8138da6b1d
195 changed files with 12619 additions and 415 deletions

View File

@@ -0,0 +1,26 @@
import {z} from 'zod'
import {db} from '@/lib/db/prisma/client'
export const categoryLocaleSchema = z.object({
lang: z.enum(['uk', 'ru']),
title: z.string().trim().min(1).max(384),
/*.refine(async current => {
const count = await db.categoryLocale.count({
where: {
title: current
}
})
return count === 0
}, "Імя категорії вже існує")*/
// slug: z.string().trim().min(5, {
// message: 'slug_required'
// }),
short_title: z.string().trim().max(384).optional(),
description: z.string().trim().max(3840).optional()
})
export const createCategoryFormSchema = z.object({
locales: z.array(categoryLocaleSchema)
})