Do not use for..in operator for iterate over an array
Change-Id: I2d73e80a313adb8a22488dd8ddaa1034ee4dd7ee
diff --git a/src/controllers/ws_manager.js b/src/controllers/ws_manager.js
index 4ce95c5..539c415 100644
--- a/src/controllers/ws_manager.js
+++ b/src/controllers/ws_manager.js
@@ -422,7 +422,7 @@
}
let results = [];
- for(let d in message.data) {
+ message.data.forEach((d) => {
if(!('workflow_id' in d)) {
// error
errorMessage = `field 'workflow_id' does not exist in message body - ${JSON.stringify(d)}`;
@@ -454,7 +454,7 @@
// set workflow status
let result = eventrouter.setWorkflowRunStatus(workflowRunId, status);
results.append(result);
- }
+ });
cb(null, results);
return;