analyser - merge data from old structure

This commit is contained in:
Jan Prochazka 2021-05-23 21:38:17 +02:00
parent 777f72af88
commit 4cce1f6670

View File

@ -77,6 +77,16 @@ export class DatabaseAnalyser {
[...(this.structure[field] || []).filter(x => !removeAllIds.includes(x.objectId)), ...newArray],
x => x.pureName
);
// merge missing data from old structure
for (const item of res[field]) {
const original = (this.structure[field] || []).find(x => x.objectId == item.objectId);
if (original) {
for (const key in original) {
if (!item[key]) item[key] = original[key];
}
}
}
}
return res;