N-FIN-6: add category server actions

This commit is contained in:
Markus Thielker 2024-03-10 17:49:54 +01:00
parent 34857eecc0
commit 39da77fc21
No known key found for this signature in database
3 changed files with 138 additions and 0 deletions

View file

@ -0,0 +1,11 @@
import { z } from 'zod';
export const categoryFormSchema = z.object({
id: z.number().positive().optional(),
name: z.string().min(1).max(32),
color: z.string()
.min(7)
.max(7)
.startsWith('#')
.refine(value => value.split('#')[1].match(/^[0-9a-fA-F]{6}$/)),
});