diff options
author | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-28 14:26:20 -0600 |
---|---|---|
committer | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-28 14:26:20 -0600 |
commit | c56d07e0e045981b33af8bbe1ff26b3dc705d073 (patch) | |
tree | 9973b86ce67d34a43767310a2b09c70f96feccac /src/main/java | |
parent | 17f7091c32a6b0dcbd69e457533a4e75c896c4a2 (diff) | |
download | ToDo-App-BE-c56d07e0e045981b33af8bbe1ff26b3dc705d073.tar.gz ToDo-App-BE-c56d07e0e045981b33af8bbe1ff26b3dc705d073.zip |
Little API call to retrieve last index used.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/encora/Main.java | 9 |
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; + } } |