API Query Order By #722
-
I have an API that is retrieving data. Does Drizzle offer a better way to create the orderBy statement?
|
Beta Was this translation helpful? Give feedback.
Answered by
Senbonzakura1234
Jun 7, 2023
Replies: 1 comment 3 replies
-
This problem can be solve by using object literal mapping, all you need is 2 object, 1 to map sord field, and the other to map sort direction query. map the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
no that's not what i mean, i mean use object literal to map condition.
like this
and in query just do this
Also i suggest to use something like zod to validate request input like
sort.colId
andsort.sort