diff options
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.java | 8 |
1 files changed, 4 insertions, 4 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 bbfd3f6..d426aee 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 @@ -55,12 +55,14 @@ public class CupboardController { LOG.log(Level.INFO, "POST /cupboard body={0}", params); String name = (String) params.get("name"); + String location = (String) params.get("location"); double maxGoal = ((Number) params.get("maxGoal")).doubleValue(); + boolean urgent = (Boolean) params.get("urgent"); Need.GoalType goalType = GoalType.valueOf((String) params.get("type")); try { authService.keyHasAccessToCupboard(key); - Need need = cupboardService.createNeed(name, maxGoal, goalType); + Need need = cupboardService.createNeed(name, location, maxGoal, goalType, urgent); return new ResponseEntity<>(need, HttpStatus.OK); } catch (DuplicateKeyException ex) { LOG.log(Level.WARNING, ex.getLocalizedMessage()); @@ -104,8 +106,6 @@ public class CupboardController { * * @param name The name parameter which contains the text used to find the {@link Need need} * - * @deprecated Searching should now be done client side in the future - * * @return ResponseEntity with array of {@link Need need} objects (may be empty) and * HTTP status of OK<br> * ResponseEntity with HTTP status of INTERNAL_SERVER_ERROR otherwise @@ -181,7 +181,7 @@ public class CupboardController { /** * Checks out a need by checkoutAmount - * + * * @param data JSON object with parameters needID and amount * @param key Key used to authenticate user * @return OK if successful, other statuses if failure |