From d692dd22603c2762c21c2e0bef8f72f7025fe41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Oliva?= Date: Thu, 25 May 2023 21:39:39 -0600 Subject: Added blank spaces everywhere. --- src/main/java/com/encora/Main.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/encora/Main.java') diff --git a/src/main/java/com/encora/Main.java b/src/main/java/com/encora/Main.java index a233550..47d72c0 100644 --- a/src/main/java/com/encora/Main.java +++ b/src/main/java/com/encora/Main.java @@ -27,6 +27,7 @@ public class Main { SpringApplication.run(Main.class, args); } + // Get all to dos. @GetMapping("/todos") @ResponseStatus(value=HttpStatus.OK) @@ -34,6 +35,7 @@ public class Main { return toDosRepository.findAll(); } + // Add a new to do. @ResponseStatus(value=HttpStatus.BAD_REQUEST, reason="Text is longer than 120 characters.") public static class longerThanMaxException extends RuntimeException {} @@ -57,6 +59,7 @@ public class Main { toDosRepository.save(todo); } + // Updates to do with new information @ResponseStatus(value=HttpStatus.BAD_REQUEST, reason="No to do with such index.") public static class toDoNotFound extends RuntimeException {} @@ -77,7 +80,6 @@ public class Main { // Update a to do with "done". - @PostMapping("/todos/{id}/done") @ResponseStatus(value=HttpStatus.OK) public void setDone(@PathVariable("id") Integer id) { @@ -90,6 +92,7 @@ public class Main { toDosRepository.save(selectedToDo); } + // Update a to do to set "done" as false. @PutMapping("/todos/{id}/undone") @ResponseStatus(value=HttpStatus.OK) -- cgit v1.2.3