| | |
| | | // debugger |
| | | const todo = { |
| | | title: state.newTodo, |
| | | completed: false |
| | | completed: false, |
| | | important: false |
| | | }; |
| | | // console.info("TESTINT BLAH BLAH ", todo); |
| | | return axios |
| | |
| | | updateTodo({ commit, state }, { id, important }) { |
| | | let i = state.todos.findIndex(todo => todo._id === id); |
| | | if (important) { |
| | | // TODO - add commit imporant here! |
| | | commit("MARK_TODO_IMPORTANT", i); |
| | | } else { |
| | | commit("MARK_TODO_COMPLETED", i); |
| | | } |
| | | console.info( |
| | | "TESTSY MC TESTFACES", |
| | | config.todoEndpoint + "/" + state.todos[i]._id |
| | | ); |
| | | // Fire and forget style backend update ;) |
| | | return axios |
| | | .put(config.todoEndpoint + "/" + state.todos[i]._id, state.todos[i]) |