refactor(categories): move mutations into use cases

This commit is contained in:
2026-06-04 22:12:06 +02:00
parent 0af25417ab
commit f48ccb8c50
7 changed files with 183 additions and 80 deletions
+18
View File
@@ -0,0 +1,18 @@
import { z } from "zod"
export const createCategorySchema = z.object({
name: z
.string()
.min(3, {
error: "Name is required and must be at least 3 characters long",
})
.nonempty("Name is required and must be at least 3 characters long"),
})
export type CreateCategoryFormType = z.infer<typeof createCategorySchema>
export const updateCategorySchema = createCategorySchema.extend({
id: z.string().nonempty("ID is required"),
})
export type UpdateCategoryFormType = z.infer<typeof updateCategorySchema>