Server-side filtering. How to convert the column filter state into the format that the backend is excepting? #324
Unanswered
its-monotype
asked this question in
Q&A
Replies: 1 comment 2 replies
-
|
Just do it you whatever function is sending your api calls. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to implement server-side column filtering for a table in my React app, but I'm having trouble converting the column filters state into the format that the backend (which uses the "nestjs-paginate" library) is expecting.
One solution could be to use the "filterFn" property for each column and pass in the filter operator that the backend is expecting (e.g. '$eq', '$gt', etc.) along with the value.
Another approach would be to define a separate mapping function that maps the "ColumnFiltersState" object into the format that the backend is expecting, using the appropriate filter operator and value for each column, but then how we would know which operator to use, maybe add custom meta prop to the "coulmnDef".
Can anyone provide some guidance on how to correctly map the column filters for the backend, and which solution would be the best approach? I would really appreciate any feedback or advice on the best approach, and even better if there is an example code to help me understand the solution better.
Beta Was this translation helpful? Give feedback.
All reactions