Feature/abniye fani

This commit is contained in:
2025-02-19 11:52:27 +00:00
committed by AmirHossein Mahmoodi
parent ed4724a7de
commit f5ff082258
33 changed files with 2085 additions and 126 deletions

View File

@@ -38,8 +38,22 @@ const DataTableProvider = ({ children, user_id, page_name, table_name, columns,
return innerObject.value === "";
}
});
const CheckHideValues = Object.values(hideData).every((value) => value === true);
const flattenObject = (obj) => {
let result = {};
for (const key in obj) {
if (typeof obj[key] === "object" && obj[key] !== null) {
Object.assign(result, flattenObject(obj[key])); // باز کردن اشیای تودرتو
} else {
result[key] = obj[key];
}
}
return result;
};
// تبدیل آبجکت به آبجکت فلت شده
const flatHideData = flattenObject(hideData);
const CheckHideValues = Object.values(flatHideData).every((value) => value === true);
hasAnyConflict =
!CheckHideValues || JSON.stringify(sortData) !== JSON.stringify(initialSort) || !CheckFilterValues;