From 2b67bd14828c8c0bffe461a66542a2dba6c19f93 Mon Sep 17 00:00:00 2001 From: benal01 Date: Sat, 22 Mar 2025 11:21:30 -0400 Subject: API creation bug fix- the max goal would not be casted properly --- .../java/com/ufund/api/ufundapi/controller/CupboardController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java') 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 36ae341..55cf88d 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,7 +50,8 @@ public class CupboardController { public ResponseEntity createNeed(@RequestBody Map params) { System.out.println(params); String name = (String) params.get("name"); - double maxGoal = (double) params.get("maxGoal"); + System.out.println("attemtping cast maxgoual"); + double maxGoal = ((Number) params.get("maxGoal")).doubleValue(); Need.GoalType goalType = GoalType.valueOf((String) params.get("type")); try { -- cgit v1.2.3 From e0a3f2c2c0fec40aa50c8889e343a1dbc7f9d7fb Mon Sep 17 00:00:00 2001 From: benal01 Date: Sat, 29 Mar 2025 15:01:12 -0400 Subject: API functionality for urgency and location --- .../java/com/ufund/api/ufundapi/controller/CupboardController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java') 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 createNeed(@RequestBody Map 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); -- cgit v1.2.3 From 1abdb1408159796d12ed28c73862dd8d186384f0 Mon Sep 17 00:00:00 2001 From: Gunther6070 Date: Sun, 30 Mar 2025 16:41:24 -0400 Subject: Fixed broken tests and made them more consistent --- .../main/java/com/ufund/api/ufundapi/controller/CupboardController.java | 2 -- 1 file changed, 2 deletions(-) (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java') 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 c62bff3..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 @@ -106,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
* ResponseEntity with HTTP status of INTERNAL_SERVER_ERROR otherwise -- cgit v1.2.3