Iterate over removed and deleted records when adding record to group

In Javascript for...in iterate over properties but we want to iterate over
values with for...of. Otherwise record added back is not un-removed or
un-deleted.

Closes #12663
This commit is contained in:
Cédric Krier committed 2023-10-29 13:49:30 +01:00
1 parent 204a5d7625
commit f1ab6513b3
1 file changed
+2 -2
+2 -2
View File
@@ -142,13 +142,13 @@
if (this.indexOf(record) < 0) {
this.splice(position, 0, record);
}
for (var record_rm in this.record_removed) {
for (var record_rm of this.record_removed) {
if (record_rm.id == record.id) {
this.record_removed.splice(
this.record_removed.indexOf(record_rm), 1);
}
}
for (var record_del in this.record_deleted) {
for (var record_del of this.record_deleted) {
if (record_del.id == record.id) {
this.record_deleted.splice(
this.record_deleted.indexOf(record_del), 1);