Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the amount validation while creating an expense #291

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yuvarajsai
Copy link
Contributor

This PR is to fix this issue #290
The current validation logic is not restricting the expense creation when the amount is "0".

After:
image

@@ -52,7 +52,7 @@ export const expenseFormSchema = z
],
{ required_error: 'amountRequired' },
)
.refine((amount) => amount != 1, 'amountNotZero')
.refine((amount) => amount != 0, 'amountNotZero')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this 1 on purpose?
Do we get something by prevent 1 cent expenses?

I assume it was a mistake, specially given the error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants