You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by GitBox <gi...@apache.org> on 2019/02/13 13:01:05 UTC

[GitHub] ruffle1986 commented on a change in pull request #1307: METRON-1944: Unable to Delete a Comment in Alerts UI

ruffle1986 commented on a change in pull request #1307: METRON-1944: Unable to Delete a Comment in Alerts UI
URL: https://github.com/apache/metron/pull/1307#discussion_r256384489
 
 

 ##########
 File path: metron-interface/metron-alerts/src/app/alerts/alert-details/alert-details.component.ts
 ##########
 @@ -260,9 +260,7 @@ export class AlertDetailsComponent implements OnInit {
         commentRequest.timestamp = deletedCommentWrapper.alertComment.timestamp;
         commentRequest.sensorType = this.alertSourceType;
         this.updateService.removeComment(commentRequest).subscribe(
-            () => {
-              this.alertCommentsWrapper.map(alertsWrapper => alertsWrapper.alertComment)
-            },
+            null,
 
 Review comment:
   I removed the next callback here because it makes no sense to map over an array and does nothing with the mapped array. 
   
   [map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map#Return_value) does not mutate the array on which you call it. It creates a brand new array with the mapped elements. The code above does nothing with the return value of map so it can be removed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services