Ali Samadi
Ali Samadi2w ago

Can we use trpc route inside another trpc route?

I have two routes, one is for generating image, and another one is uploading and creating a row in DB. So I am wondering if we can use the generating image route after the creating row in DB.
1 Reply
Nick
Nick2w ago
You can use createCaller to call another route server-side, but we generally recommend you pull the necessary logic out into functions and call those instead. Calling a procedure from a procedure means running the middleware chain again which is just unnecessary work

Did you find this page helpful?