diff options
| author | beanplebs <benalmstead@gmail.com> | 2025-02-16 14:14:20 -0500 |
|---|---|---|
| committer | beanplebs <benalmstead@gmail.com> | 2025-02-16 14:14:20 -0500 |
| commit | 6c32da25ccbcd0568f7b34cd81565609625435ef (patch) | |
| tree | 5cbf2efd7230b5c004188d6e18cba6679ca399d5 /ufund-api/src/main/java/com/ufund/api/ufundapi/controller | |
| parent | 5e073d64d3d364c090f21c5e34ae273955009a1a (diff) | |
| download | JellySolutions-6c32da25ccbcd0568f7b34cd81565609625435ef.tar.gz JellySolutions-6c32da25ccbcd0568f7b34cd81565609625435ef.tar.bz2 JellySolutions-6c32da25ccbcd0568f7b34cd81565609625435ef.zip | |
updateNeed Controller and Cupboard functionality
Diffstat (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/controller')
| -rw-r--r-- | ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java | 10 |
1 files changed, 8 insertions, 2 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 106b2e0..0de3403 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 @@ -41,8 +41,14 @@ public class CupboardController { } @PutMapping("") - public void updateNeed(@RequestBody Need need) { - cupboard.updateNeed(need); + public ResponseEntity<Need> updateNeed(@RequestBody Need need) { + try { + need = cupboard.updateNeed(need); + return new ResponseEntity<>(need, HttpStatus.OK); + } catch (IOException e) { + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + } @DeleteMapping("/{id}") |
