diff options
author | benal01 <bja4245@rit.edu> | 2025-03-29 15:01:12 -0400 |
---|---|---|
committer | benal01 <bja4245@rit.edu> | 2025-03-29 15:01:12 -0400 |
commit | e0a3f2c2c0fec40aa50c8889e343a1dbc7f9d7fb (patch) | |
tree | 7b8c9811964e566ed4bc930e929301990538b82e /ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java | |
parent | 61b5b762b150c82e7d48190bcfe3416bfea96059 (diff) | |
download | JellySolutions-e0a3f2c2c0fec40aa50c8889e343a1dbc7f9d7fb.tar.gz JellySolutions-e0a3f2c2c0fec40aa50c8889e343a1dbc7f9d7fb.tar.bz2 JellySolutions-e0a3f2c2c0fec40aa50c8889e343a1dbc7f9d7fb.zip |
API functionality for urgency and location
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); |