Adding filter capacities to api client and server

This commit is contained in:
2025-01-20 16:08:42 +01:00
parent 35448385c5
commit 0a4bec62c1
7 changed files with 32 additions and 36 deletions

View File

@@ -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 + "%");
}
});
}