aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/encora/Main.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/encora/Main.java')
-rw-r--r--src/main/java/com/encora/Main.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/encora/Main.java b/src/main/java/com/encora/Main.java
index 47d72c0..dbd3364 100644
--- a/src/main/java/com/encora/Main.java
+++ b/src/main/java/com/encora/Main.java
@@ -79,6 +79,14 @@ public class Main {
}
+ // Deletes a to do by index.
+ @DeleteMapping("/todos/{id}")
+ @ResponseStatus(value=HttpStatus.OK)
+ public void removeToDo(@PathVariable("id") Integer id) {
+ toDosRepository.deleteById(id);
+ }
+
+
// Update a to do with "done".
@PostMapping("/todos/{id}/done")
@ResponseStatus(value=HttpStatus.OK)