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 | 5 |
1 files changed, 3 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 55cf88d..f79e445 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 @@ -50,12 +50,13 @@ public class CupboardController { public ResponseEntity<Need> createNeed(@RequestBody Map<String, Object> params) { System.out.println(params); String name = (String) params.get("name"); - System.out.println("attemtping cast maxgoual"); + 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 { - 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) { return new ResponseEntity<>(HttpStatus.CONFLICT); |