Skip to content

Commit 52bbce0

Browse files
complete method handleDone
1 parent 3c2a0bb commit 52bbce0

File tree

1 file changed

+8
-0
lines changed
  • ep12-make-done-really-work/app/components

1 file changed

+8
-0
lines changed

ep12-make-done-really-work/app/components/App.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ export default class App extends React.Component {
1414

1515
handleDone (titleToBeMarkedAsDone) {
1616
console.log(titleToBeMarkedAsDone + " wants to be marked as done");
17+
var _todos = this.state.todos;
18+
var todo = _todos.filter((todo) => {
19+
return todo.title === titleToBeMarkedAsDone;
20+
})[0];
21+
22+
todo.done = !todo.done;
23+
24+
this.setState({ todos: _todos });
1725
}
1826

1927
handleDelete (titleToBeDeleted) {

0 commit comments

Comments
 (0)