Paddy
Node 20, NPM: Send form values to DB with tRPC?
In my preferred use case I would like to have an api request, trpc route for example ''/api/post" in 'src/app/api/trpc/route.ts' that is being called in the onSubmit event, hopefully you understand what I mean, is there any docs where I could find this more.
I was looking at this now:
https://trpc.io/docs/server/adapters/nextjs#route-handlers
This seems interesting but can't seem to understand how to use a mutation in here.
Please let me know, I am very clueless at this point.
5 replies
Node 20, NPM: Send form values to DB with tRPC?
Hey,
thank you so much for your answer! How can I call the mutation exactly that's in the form component, I understand I'll put it in the onSubmit event, but I am not so sure on how to get the mutation? And sorry, what do you mean with 'map it's schema'?
Please let me know, I would very appreciate your help with this.
Best regards.
5 replies