WIP Добвил обновление Основных данных в БД

This commit is contained in:
DwCay
2023-04-07 20:00:02 +03:00
parent b1e9a96164
commit efaf968738
5 changed files with 151 additions and 30 deletions

View File

@@ -0,0 +1,21 @@
export function removeEmptyFields(obj) {
let resultObj = {};
Object.keys(obj)
.filter(
(key) => obj[key] !== undefined && obj[key] !== null && obj[key] !== ""
)
.forEach((key) => {
resultObj[key] = obj[key];
});
return resultObj;
}
export function getObjectChangeField(objInit, objUpdate) {
const resultObj = {};
Object.keys(objUpdate).forEach((key) => {
if (objUpdate[key] !== objInit[key]) {
resultObj[key] = objUpdate[key];
}
});
return resultObj;
}