aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;
+ }
}