mirror of
https://codeberg.org/MarkusThielker/finances.git
synced 2025-07-01 11:09:18 +00:00
N-FIN-6: add category server actions
This commit is contained in:
parent
34857eecc0
commit
39da77fc21
3 changed files with 138 additions and 0 deletions
11
src/lib/form-schemas/categoryFormSchema.ts
Normal file
11
src/lib/form-schemas/categoryFormSchema.ts
Normal 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}$/)),
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue