refactor: replace forEach with for-in loop in order summary
Change iteration method to properly skip unwanted properties and improve readability.
This commit is contained in:
@@ -1048,15 +1048,15 @@
|
||||
},
|
||||
});
|
||||
let isloadSummary = false;
|
||||
dataJSON.forEach((element) => {
|
||||
for (let element in dataJSON) {
|
||||
if (["currentPage", "displayCount"].includes(element)) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
if (currentDataInfo[element] != dataJSON[element]) {
|
||||
currentDataInfo[element] = dataJSON[element];
|
||||
isloadSummary = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (isloadSummary) {
|
||||
AjaxOrderSummaryList(dataJSON);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user