aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java
diff options
context:
space:
mode:
authorGunther6070 <haydenhartman10@yahoo.com>2025-02-16 13:37:52 -0500
committerGunther6070 <haydenhartman10@yahoo.com>2025-02-16 13:37:52 -0500
commit5e073d64d3d364c090f21c5e34ae273955009a1a (patch)
tree02ca2f86685e93d85e93608415d1c8f9af20bf0c /ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java
parent43523d16696b0dcbbd1d44af3e31f08de702d921 (diff)
downloadJellySolutions-5e073d64d3d364c090f21c5e34ae273955009a1a.tar.gz
JellySolutions-5e073d64d3d364c090f21c5e34ae273955009a1a.tar.bz2
JellySolutions-5e073d64d3d364c090f21c5e34ae273955009a1a.zip
Reverted getNeed change
Diffstat (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java')
-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("")