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') 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