Skip to content

Commit 7fbdcf8

Browse files
let action add TODO
1 parent 2824cd4 commit 7fbdcf8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ep25-add-todo-using-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
addTodo: (todo) => {
77
console.log("adding TODO");
8+
api.addTodo(todo)
9+
.then( () => {
10+
console.log("Added TODO successfully");
11+
TodoActions.getAllTodos();
12+
})
813
},
914

1015
deleteTodo: (todo) => {

ep25-add-todo-using-flux/app/components/App.jsx

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

4040
var newTodo = { title: this.state.title, done: false };
4141

42-
this.addTodo(newTodo);
42+
//this.addTodo(newTodo);
4343
TodoActions.addTodo(newTodo);
4444
}
4545

0 commit comments

Comments
 (0)