Hello. Im reworking on typescript. I use Prisma In...
# orm-help
p
Hello. Im reworking on typescript. I use Prisma Input Types on express Request. Make this sense? Because i getting trouble when im sending relational objects
l
Hello, I think splitting the ownerships is the better way for me. I usually create DTOs for the models used in the request o response. After that typically used a repository to encapsulate the data access layer. So at your question, I would respond no. Creating different layers in your application helps you to take your code clean, testable, and durable. Another reason to answer no at your answer is that in this case if you use the Prisma types in your express request or response, you are creating a strong relationship between your API and your database, and if you change your table probably you are changing your API too.