-
-
Save gavilanch/3bdc8b518f708fac2fdf756bce997e98 to your computer and use it in GitHub Desktop.
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
handleModalTodoFormClose(response) { | |
// is response an object? | |
if (response === Object(response)) { | |
if (response.createMode) { | |
response.todo.id = response.id; | |
this.todos.unshift(response.todo); | |
} else { | |
let index = this.todos.findIndex(value => value.id == response.id); | |
this.todos[index] = response.todo; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment