cadams
Explore posts from serversTTCTheo's Typesafe Cult
•Created by cadams on 12/12/2023 in #questions
Correct if wrong: Since a tRPC procedure is a hook, they cant be used in the next api/ routes
Hooks can only be used inside components - this makes me think how limiting tRPC is if it can only be used from the front end :/ ?
I have a procedure that my front end uses, now I want the backend (in next api/ route) to use this procedure too and send an email.
I know there are a lot questions around using tRPC procedures outside a project (https://github.com/jlalmes/trpc-openapi i think this solves that dilemma), this is similar that I what to use the procedure, but just from the backend in the same project.
5 replies
TTCTheo's Typesafe Cult
•Created by cadams on 12/9/2023 in #questions
Inserting into DB with prisma in api route
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1183033787609784330/image.png)
2 replies
TTCTheo's Typesafe Cult
•Created by cadams on 11/3/2023 in #questions
Do you manually create Zod schemas for your Prisma models?
I found myself doing this and thought there should be a better way, cause I have to make the same change in two places. I then googled "prisma zod" saw someone created this, which trys to solve this (I still yet to try it): https://github.com/CarterGrimmeisen/zod-prisma.
I was also wondering if Drizzle possibly has this "one source of type truth" solution built in?
11 replies
TTCTheo's Typesafe Cult
•Created by cadams on 10/8/2023 in #questions
Non-primitive fields not showing on variables of type from RouterOutputs.
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1160578503150944266/image.png)
13 replies
TTCTheo's Typesafe Cult
•Created by cadams on 9/25/2023 in #questions
When to use "src/page/api/doStuff.ts" vs "src/server/api/routers/routerThatDoesStuff.ts"
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1155905922363818044/image.png)
11 replies