aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/encora/ToDosRepository.java
diff options
context:
space:
mode:
authorAdrián Oliva <adrian.oliva@cimat.mx>2023-05-25 19:29:46 -0600
committerAdrián Oliva <adrian.oliva@cimat.mx>2023-05-25 19:29:46 -0600
commitf48cf17ecedade7502c4d09f6f7a90e84f3776f3 (patch)
tree10347681442bcafede777eab2fd9a331c3780d2f /src/main/java/com/encora/ToDosRepository.java
parent7bf30fc960b07a7cdc93ac469a5c2982f6cf53aa (diff)
downloadToDo-App-BE-f48cf17ecedade7502c4d09f6f7a90e84f3776f3.tar.gz
ToDo-App-BE-f48cf17ecedade7502c4d09f6f7a90e84f3776f3.zip
POST to set done.
POST on /todos/{id}/done to set the to do with {id} done. :3
Diffstat (limited to 'src/main/java/com/encora/ToDosRepository.java')
-rw-r--r--src/main/java/com/encora/ToDosRepository.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/main/java/com/encora/ToDosRepository.java b/src/main/java/com/encora/ToDosRepository.java
index 5b8b292..f19d1ce 100644
--- a/src/main/java/com/encora/ToDosRepository.java
+++ b/src/main/java/com/encora/ToDosRepository.java
@@ -66,6 +66,21 @@ public class ToDosRepository implements JpaRepository<ToDos, Integer> {
return null;
}
+ // Retrieve a to do.
+ @Override
+ public ToDos getById(Integer integer) {
+ ToDos selectedToDo;
+
+ for (int index = 0; index < this.todos.size(); index++) {
+ selectedToDo = this.todos.get(index);
+ if (Objects.equals(selectedToDo.getId(), integer)) {
+ return selectedToDo;
+ }
+ }
+
+ return null;
+ }
+
/*
* N O T Y E T D E F I N E D .
*/
@@ -105,11 +120,6 @@ public class ToDosRepository implements JpaRepository<ToDos, Integer> {
}
@Override
- public ToDos getById(Integer integer) {
- return null;
- }
-
- @Override
public ToDos getReferenceById(Integer integer) {
return null;
}