diff options
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 | 4 |
1 files changed, 2 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 2cf8647..075878a 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 @@ -197,13 +197,13 @@ public class CupboardController { for (Map<String, Integer> map : data) { int needID = map.get("needID"); - if (cupboardService.getNeed(needID) != null) { + if (cupboardService.getNeed(needID) == null) { return new ResponseEntity<>("One or more need is invalid, please refresh.", HttpStatus.BAD_REQUEST); } } for (Map<String, Integer> map : data) { int needID = map.get("needID"); - int checkoutAmount = map.get("amount"); + int checkoutAmount = map.get("quantity"); cupboardService.checkoutNeed(needID, checkoutAmount, key); } return new ResponseEntity<>(HttpStatus.OK); |