Skip to content

Commit c350cba

Browse files
delete TODO using Action
1 parent 27f1e10 commit c350cba

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ep24-marching-towards-flux/app/actions/TodoActions.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ var TodoActions = {
55

66
deleteTodo: (todo) => {
77
console.log("Deleting TODO");
8+
api.deleteTodo(todo.id)
9+
.then( () => {
10+
console.log("Deleted TODO successfully");
11+
TodoActions.getAllTodos();
12+
})
813
},
914

1015
markTodoDone: (todo) => {

ep24-marching-towards-flux/app/components/DisplayItem.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default class DisplayItem extends React.Component {
3838

3939
handleDeleteTodoClick (todo) {
4040
TodoActions.deleteTodo(todo);
41-
this.props.handleDelete(todo.id);
41+
//this.props.handleDelete(todo.id);
4242
}
4343

4444
render () {

0 commit comments

Comments
 (0)