aboutsummaryrefslogtreecommitdiff
path: root/src/ToDo.jsx
diff options
context:
space:
mode:
authorAdrián Oliva <adrian.oliva@cimat.mx>2023-05-18 13:59:48 -0600
committerAdrián Oliva <adrian.oliva@cimat.mx>2023-05-18 13:59:48 -0600
commit8e274132e60b21277506df3c7b47e5f75518fb32 (patch)
treef7cd47d25cd7071f4e56de61486d65690476ae2d /src/ToDo.jsx
parent8cb67965e363a9ea602a51d6bdee1c4d1e067c54 (diff)
downloadToDo-App-FE-8e274132e60b21277506df3c7b47e5f75518fb32.tar.gz
ToDo-App-FE-8e274132e60b21277506df3c7b47e5f75518fb32.zip
Added remove action.
Diffstat (limited to '')
-rw-r--r--src/ToDo.jsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ToDo.jsx b/src/ToDo.jsx
index 1dbfad7..3644db3 100644
--- a/src/ToDo.jsx
+++ b/src/ToDo.jsx
@@ -3,6 +3,7 @@ import { useSelector, useDispatch } from "react-redux";
import {
add_todo,
change_done,
+ remove_todo,
select_todos,
select_last_index,
} from "./features/todo/reducer";
@@ -241,7 +242,9 @@ export function ListToDos() {
<button
type="button"
className="btn btn-outline-dark"
- disabled
+ onClick={(e) =>
+ dispatch(remove_todo(item.id))
+ }
>
Delete
</button>