aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrián Oliva <adrian.oliva@cimat.mx>2023-05-28 14:26:20 -0600
committerAdrián Oliva <adrian.oliva@cimat.mx>2023-05-28 14:26:20 -0600
commitc56d07e0e045981b33af8bbe1ff26b3dc705d073 (patch)
tree9973b86ce67d34a43767310a2b09c70f96feccac /src
parent17f7091c32a6b0dcbd69e457533a4e75c896c4a2 (diff)
downloadToDo-App-BE-c56d07e0e045981b33af8bbe1ff26b3dc705d073.tar.gz
ToDo-App-BE-c56d07e0e045981b33af8bbe1ff26b3dc705d073.zip
Little API call to retrieve last index used.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/encora/Main.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/encora/Main.java b/src/main/java/com/encora/Main.java
index ad86fc4..a8d86ba 100644
--- a/src/main/java/com/encora/Main.java
+++ b/src/main/java/com/encora/Main.java
@@ -165,4 +165,13 @@ public class Main {
public List<ToDos> getFilteredToDos(@RequestBody toDoFilters filters) throws Exception {
return toDosRepository.findAllWithFilter(filters.name(), filters.priority(), filters.done());
}
+
+
+ // Retrieve last index used.
+ @CrossOrigin(origins=allowed_origin)
+ @GetMapping("/todos/lastIndex")
+ @ResponseStatus(value=HttpStatus.OK)
+ public Integer giveMeLastID() {
+ return toDosRepository.lastId;
+ }
}