generated from Dicken/dickendock
Commit 4: Kategorien-API (CRUD + Reorder) und Favoriten-Toggle im Frontend
This commit is contained in:
@@ -46,3 +46,22 @@ export const ServiceUpdateSchema = ServiceCreateSchema.omit({
|
||||
deviceId: true,
|
||||
}).partial();
|
||||
export type ServiceUpdateInput = z.infer<typeof ServiceUpdateSchema>;
|
||||
|
||||
export const CategoryCreateSchema = z.object({
|
||||
name: z.string().min(1, "name darf nicht leer sein"),
|
||||
});
|
||||
export type CategoryCreateInput = z.infer<typeof CategoryCreateSchema>;
|
||||
|
||||
export const CategoryUpdateSchema = CategoryCreateSchema.partial();
|
||||
export type CategoryUpdateInput = z.infer<typeof CategoryUpdateSchema>;
|
||||
|
||||
/** Für Drag & Drop: neue Reihenfolge mehrerer Kategorien auf einmal setzen. */
|
||||
export const CategoryReorderSchema = z
|
||||
.array(
|
||||
z.object({
|
||||
id: z.string().min(1),
|
||||
order: z.number(),
|
||||
})
|
||||
)
|
||||
.min(1, "mindestens ein Eintrag erforderlich");
|
||||
export type CategoryReorderInput = z.infer<typeof CategoryReorderSchema>;
|
||||
|
||||
Reference in New Issue
Block a user