-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
[ASK] can I not destructure the validated object? #99
Comments
Form Actions support is on the way, I'm waiting for
Can you please provide an example via code snippet? Thank you. |
For clarity my validator is called tourClient because I have separate validators for frontend UX and more complete validators we use before allowing publishing of content. Here I'd love to just get the data object and save it to the DB instead of destructuring and restructuring the whole object.
vs what I'd like is something like this
|
Oh, I see. Yes, you absolutely can use |
Okay, now I got it! Turns out my server action issues were due to middleware for my auth solution(supertokens). Now next-safe-actions are working properly. Before I was seeing the network request being made and json come back but the result was undefinded. Haven't tested the react useFormState again since discovering the underlying problem but I'm pretty sure that was the cause. Thanks! |
Is there an existing issue for this?
Library version (optional)
6.2.0
Ask a question
Overall love this library, was really struggling with the useFormState hook and never could get to it to work right.
My question is regarding the action arguments. For small examples like on the website it makes sense to destructure the particular properties you need. However for a large data model with a dozen or more properties I'd much prefer to just take the object and pass it along to my DB without a huge destructure in the function signature and then restructuring it for saving it in the db. Hoping it's possible, if not this would be a feature request.
Thanks for your contributions!
Additional context
No response
The text was updated successfully, but these errors were encountered: