Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Created June 9, 2017 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/5878be684fab0b26e2d000906bfa3c19 to your computer and use it in GitHub Desktop.
Save matthieu-D/5878be684fab0b26e2d000906bfa3c19 to your computer and use it in GitHub Desktop.
deleteTask(task, index) {
let self = this;
this.db.getDocumentClient().delete({
'TableName': self.taskTable,
'Key': {
'userId': AWS.config.credentials.identityId,
'taskId': task.taskId
}
}).promise().then((data) => {
this.items.splice(index, 1);
}).catch((err) => {
console.log('there was an error', err);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment