Zod - sort schema
Hi. I am adding sort option to prisma
findMany
query. Since I don't know zod very well, I could not think of any possible type-safe solution.
Sort format should be: columnFieldName:orderType
, so for example: firstName:desc
.
I made my types from @prisma/client
, but don't know how to add them to tRPC input.
Is it even possible?
4 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I just realized maybe putting it all in one string isn't best solution... I might add two properties like:
sortBy
along with order
Sure, I thought it so. Thanks
I think one of the possible solutions would be to use regexUnknown User•3y ago
Message Not Public
Sign In & Join Server To View
okay ^^