Skip to content
Discussion options

You must be logged in to vote

If you pass FormData as input when calling server action, the input will be form-data

export const getting = pub
  .input(z.instanceof(FormData))
  .handler(async ({ input }) => {
    console.log({ input })
    // return `Hello ${input.name}!`
  })
  .actionable()

In other word, the input is whatever you pass when calling (make sure nextjs support transfer it)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@lazakrisz
Comment options

Answer selected by lazakrisz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants