aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/main/java/com/ufund/api/ufundapi/controller
diff options
context:
space:
mode:
authorbenal01 <bja4245@rit.edu>2025-03-29 15:01:12 -0400
committerbenal01 <bja4245@rit.edu>2025-03-29 15:01:12 -0400
commite0a3f2c2c0fec40aa50c8889e343a1dbc7f9d7fb (patch)
tree7b8c9811964e566ed4bc930e929301990538b82e /ufund-api/src/main/java/com/ufund/api/ufundapi/controller
parent61b5b762b150c82e7d48190bcfe3416bfea96059 (diff)
downloadJellySolutions-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')
-rw-r--r--ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java5
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);