triggerScanner/handler.js
// deletes a trigger from the corresponding dynamoDB table
deletes a trigger from the corresponding dynamoDB table
deletes a trigger from the corresponding dynamoDB table
function deleteTrigger(trigger) {
  var params = {
    TableName: "AlertTriggers",
    Key: {
      "accountId": trigger.accountId,
      "timestamp": trigger.timestamp
    }
  };
  docClient.delete(params, function(err, data) {
    if (err) {
      console.error("Unable to delete item. Error JSON:", JSON.stringify(err, null, 2));
    } else {
      console.log("DeleteItem succeeded:", JSON.stringify(data, null, 2));
      console.log("workers alerted for trigger: " + JSON.stringify(trigger));
    }
  });
}
function deleteTrigger ( trigger ) { var params = { TableName : "AlertTriggers" , Key : { "accountId" : trigger . accountId , "timestamp" : trigger . timestamp } } ; docClient . delete ( params , function ( err , data ) { if ( err ) { console . error ( "Unable to delete item. Error JSON:" , JSON . stringify ( err , null , 2 ) ) ; } else { console . log ( "DeleteItem succeeded:" , JSON . stringify ( data , null , 2 ) ) ; console . log ( "workers alerted for trigger: " + JSON . stringify ( trigger ) ) ; } } ) ; }
deletes a trigger from the corresponding dynamoDB table
deletes a trigger from the corresponding dynamoDB table