Skip to content

Commit

Permalink
fix logic update todo
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenvanhuan243 committed Apr 11, 2024
1 parent 7e57ddc commit 6cb5b59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const addTodoReducer = createSlice({
updateTodos: (state, action) => {
const { id, item } = action.payload;
return state.map((todo) => {
return todo.id === id ? todo : { ...todo, item, };
return todo.id === id ? { ...todo, item, } : todo;
});
},
completeTodos: (state, action) => {
Expand Down

0 comments on commit 6cb5b59

Please sign in to comment.