make hide action of datatable own

This commit is contained in:
2024-07-21 17:50:17 +03:30
parent bd6ea0aeae
commit d3bc855f39
15 changed files with 229 additions and 371 deletions

View File

@@ -1,10 +1,10 @@
export const flattenArrayOfObjects = (array, key) => {
return array.reduce((acc, obj) => {
acc.push(obj);
if (Array.isArray(obj[key])) {
acc.push(...flattenArrayOfObjects(obj[key]));
} else {
acc.push(obj);
acc.push(...flattenArrayOfObjects(obj[key], key));
}
return acc;
}, []);
};