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: Meal Plan Notes allow Submission Without Title/Note Text #4615

Merged
merged 12 commits into from
Dec 4, 2024

Conversation

Arshad561
Copy link
Contributor

What type of PR is this?

  • bug

What this PR does / why we need it:

Currently, when creating a new meal planner, the user can attempt to create a meal without providing a meal recipe or title. This results in a 422 error from the server.

With this fix:

  • The "Create" button will be disabled if the meal recipe or title is empty.
  • This ensures a smoother user experience and prevents invalid submissions.

Before my change

Screenshot 2024-11-26 at 12 20 41 PM

After my change


Screenshot 2024-11-26 at 12 20 55 PM

Which issue(s) this PR fixes:

Fixes #2446

Special notes for your reviewer:

Please focus on the changes made to the validation logic for enabling/disabling the "Create" button and ensure that the edge cases for validation are covered.

Testing:

  • Tested the meal planner form to verify that the "Create" button is only enabled when:
    • A meal recipe is selected, or
    • A meal title is entered.
  • Attempted to submit invalid data (empty fields) to confirm that the button remains disabled.

@Arshad561
Copy link
Contributor Author

@hay-kot I have made the change. Can you have a look at it?

@Arshad561 Arshad561 requested a review from hay-kot December 3, 2024 22:09
@hay-kot hay-kot enabled auto-merge (squash) December 4, 2024 01:58
@hay-kot hay-kot merged commit f1e9615 into mealie-recipes:mealie-next Dec 4, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[nightly] - Meal Plan Notes allow Submission Without Title/Note Text, but Return 422
2 participants