aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java
diff options
context:
space:
mode:
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.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 d426aee..ea86aa8 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
@@ -5,7 +5,6 @@ import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
-import com.ufund.api.ufundapi.service.AuthService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
@@ -22,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.ufund.api.ufundapi.DuplicateKeyException;
import com.ufund.api.ufundapi.model.Need;
import com.ufund.api.ufundapi.model.Need.GoalType;
+import com.ufund.api.ufundapi.service.AuthService;
import com.ufund.api.ufundapi.service.CupboardService;
@RestController
@@ -58,11 +58,12 @@ public class CupboardController {
String location = (String) params.get("location");
double maxGoal = ((Number) params.get("maxGoal")).doubleValue();
boolean urgent = (Boolean) params.get("urgent");
+ String description = (String) params.get("description");
Need.GoalType goalType = GoalType.valueOf((String) params.get("type"));
try {
authService.keyHasAccessToCupboard(key);
- Need need = cupboardService.createNeed(name, location, maxGoal, goalType, urgent);
+ Need need = cupboardService.createNeed(name, location, maxGoal, goalType, urgent, description);
return new ResponseEntity<>(need, HttpStatus.OK);
} catch (DuplicateKeyException ex) {
LOG.log(Level.WARNING, ex.getLocalizedMessage());