aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java27
1 files changed, 2 insertions, 25 deletions
diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java
index 27185b0..106b2e0 100644
--- a/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java
+++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java
@@ -35,32 +35,9 @@ public class CupboardController {
return cupboard.findNeeds(name);
}
- /**
- * Responds to the GET request for a {@linkplain Need need} for the given id
- *
- * @param id The id used to locate the {@link Need need}
- *
- * @return ResponseEntity with {@link Need need} object and HTTP status of OK if found<br>
- * ResponseEntity with HTTP status of NOT_FOUND if not found<br>
- * ResponseEntity with HTTP status of INTERNAL_SERVER_ERROR otherwise
- */
@GetMapping("/{id}")
- public ResponseEntity<Need> getNeed(@PathVariable int id) {
- LOG.log(Level.INFO, "GET /need/{0}", id);
-
- try {
- Need need = cupboard.getNeed(id);
- if (need != null) {
- return new ResponseEntity<>(need, HttpStatus.OK);
- } else {
- return new ResponseEntity<>(HttpStatus.NOT_FOUND);
- }
-
- } catch (IOException e) {
- LOG.log(Level.SEVERE, e.getLocalizedMessage());
- return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
- }
-
+ public Need getNeed(@PathVariable int id) {
+ return cupboard.getNeed(id);
}
@PutMapping("")