-
-
Save bakasura980/9a5f98b3fd18232f583b6c0b95ae11d8 to your computer and use it in GitHub Desktop.
EOSLime shape blockchain service - removeTodo function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async removeTodo (todo) { | |
// Call contract method "remove" in the blockchain | |
const txReceipt = await this.todoContract.remove(todo.id); | |
// Remove todo from local todosList cache | |
const todoIndex = this.todosList[todo.state].findIndex((todoElement) => todoElement.id === todo.id); | |
this.todosList[todo.state].splice(todoIndex, 1); | |
return txReceipt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment