-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Set action input default values from zod if FormData key is not present #11655
Conversation
🦋 Changeset detectedLatest commit: 4b336dd The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Adding some context on why I added this: I was working on server actions and I have a file input that accepts multiple files. I'm using zod with a property of It looks like the There might be a case when someone could chain a bunch of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, that was my (de)fault for not checking against default
validators. Great fix! Just a couple comments
* fix: remove duplicate while loop. use correct boolean values on validation * chore: rephrase changeset
1b964dc
to
4b336dd
Compare
Hey @bholmesdev, I've updated my code. Let me know if there's anything you think I might have missed! |
Changes
Resolves #11659
This changes
formDataToObject
to allow default values to be set from zod.Testing
Add tests to capture changes. I ran unit tests for this specific change and it passes. Not sure if the whole project tests are working correctly since I was getting some failures.
Docs