make hide action of datatable own
This commit is contained in:
@@ -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;
|
||||
}, []);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user