Moved filter function to shared

This commit is contained in:
2023-04-12 18:28:48 +02:00
parent 38d3e1912c
commit 2304b12c1c
2 changed files with 32 additions and 32 deletions

View File

@@ -0,0 +1,20 @@
export const groupFilter = (row, columnId, value) => {
const group = row.getValue(columnId);
if (group.responseType === "RUNNERORGANIZATION") {
return group.name.toLowerCase().includes(value.toLowerCase());
} else if (value.includes(">")) {
value = value.split(">")[1];
if (value.length == 0) {
return group.name.toLowerCase().includes(value.toLowerCase());
}
return (
group.name.toLowerCase().includes(value.toLowerCase()) ||
group.parentGroup.name.toLowerCase().includes(value.toLowerCase())
);
} else {
return (
group.name.toLowerCase().includes(value.toLowerCase()) ||
group.parentGroup.name.toLowerCase().includes(value.toLowerCase())
);
}
};