Adding filter capacities to api client and server
This commit is contained in:
@@ -55,9 +55,8 @@ export const dataProvider: DataProvider = {
|
||||
|
||||
if (filters && filters.length > 0) {
|
||||
filters.forEach((filter) => {
|
||||
if ("field" in filter && filter.operator === "eq") {
|
||||
// Our fake API supports "eq" operator by simply appending the field name and value to the query string.
|
||||
params.append(filter.field, filter.value);
|
||||
if ("field" in filter && filter.value.length > 0 && filter.operator === "contains") {
|
||||
params.append(filter.field + "__like", "%" + filter.value + "%");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user