Fix the amount validation while creating an expense (#291)

This commit is contained in:
Yuvaraj Sai
2025-04-19 23:25:24 +05:30
committed by GitHub
parent 9302a32f4c
commit f9307fd22d

View File

@@ -52,7 +52,7 @@ export const expenseFormSchema = z
], ],
{ required_error: 'amountRequired' }, { required_error: 'amountRequired' },
) )
.refine((amount) => amount != 1, 'amountNotZero') .refine((amount) => amount != 0, 'amountNotZero')
.refine((amount) => amount <= 10_000_000_00, 'amountTenMillion'), .refine((amount) => amount <= 10_000_000_00, 'amountTenMillion'),
paidBy: z.string({ required_error: 'paidByRequired' }), paidBy: z.string({ required_error: 'paidByRequired' }),
paidFor: z paidFor: z