mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-22 22:48:15 +02:00
Merge pull request #379 from R0m1k3/1.1
Improve handling of optional amount fields in transaction forms
This commit is contained in:
2 files changed
+1
-1
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
@@ -71,7 +71,7 @@ const avoirSchema = z.object({
|
|||||||
supplierId: z.coerce.number().min(1, "Veuillez sélectionner un fournisseur"),
|
supplierId: z.coerce.number().min(1, "Veuillez sélectionner un fournisseur"),
|
||||||
groupId: z.coerce.number().min(1, "Veuillez sélectionner un magasin"),
|
groupId: z.coerce.number().min(1, "Veuillez sélectionner un magasin"),
|
||||||
invoiceReference: z.string().optional(),
|
invoiceReference: z.string().optional(),
|
||||||
amount: z.coerce.number().positive().optional(),
|
amount: z.preprocess((val) => val === "" ? undefined : val, z.coerce.number().positive().optional()),
|
||||||
comment: z.string().optional(),
|
comment: z.string().optional(),
|
||||||
commercialProcessed: z.boolean().optional(),
|
commercialProcessed: z.boolean().optional(),
|
||||||
status: z.enum(["En attente de demande", "Demandé", "Reçu"]).optional(),
|
status: z.enum(["En attente de demande", "Demandé", "Reçu"]).optional(),
|
||||||
|
|||||||
Reference in new issue
Block a user