IdoPesok/zsa

Support multiple input arguments

Exzotic5485 opened this issue · 2 comments

It would be nice to be able to pass multiple arguments to the server action, this would make it easier to pass additional arguments with the bind method as this can be done with server actions normally.

For reference: https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations#passing-additional-arguments

Hi, if you are using useServerAction with an action with type as formData, you can pass in additional data in the second argument of the execute method.

In this example, name comes from the form and I pass in the other args through code.

Screen Shot 2024-07-04 at 12 26 04 PM Screen Shot 2024-07-04 at 12 27 27 PM

Still thinking about a bind solution, but lmk if this solves your problem.

Hi, just made a release to hopefully make this easier. Please try upgrading to zsa-react@0.2.2 and checkout these docs

Going to close this issue for now -- lmk if this still doesn't solve your problem.