From c56d07e0e045981b33af8bbe1ff26b3dc705d073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Oliva?= Date: Sun, 28 May 2023 14:26:20 -0600 Subject: Little API call to retrieve last index used. --- src/main/java/com/encora/Main.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main') 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 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; + } } -- cgit v1.2.3