Stivo
Stivo
Explore posts from servers
TtRPC
Created by Stivo on 3/18/2024 in #❓-help
Is there a way to pass parameters to procedure on call?
I would like to pass the required permission to the procedure like in this example:
create: authedProcedure("user.create").input(createUserSchema).mutation(async ({ input }) => {
return createUserHandler({ input })
}),
create: authedProcedure("user.create").input(createUserSchema).mutation(async ({ input }) => {
return createUserHandler({ input })
}),
Any idea how i could achieve this?
3 replies
TtRPC
Created by Stivo on 1/13/2023 in #❓-help
Is it possible to create a generic router to pass a type on?
Hi, I was wondering if it is possible to create a generic router to pass a type which is expected to return
4 replies
TtRPC
Created by Stivo on 1/7/2023 in #❓-help
Right way to catch all unexpected errors before they reach the user
Hi, I was wondering, what's the right way to catch all unexpected errors (like db errors) and replace them with simple "Internal Server Error" erros, before they get to the user. Is it possible to achieve this via middleware?
2 replies
TtRPC
Created by Stivo on 1/5/2023 in #❓-help
Right way to structure your code when using tRPC?
I was wondering how you properly structure your tRPC ruter code? Writing all the code in the routers can become messy quickly. Do you split it up in controller and service files (MVC)?
3 replies