diff options
| author | Gunther6070 <haydenhartman10@yahoo.com> | 2025-04-03 15:35:12 -0400 | 
|---|---|---|
| committer | Gunther6070 <haydenhartman10@yahoo.com> | 2025-04-03 15:35:12 -0400 | 
| commit | 75f5ad5fb154811d7acd236687bb7f30bb7c10aa (patch) | |
| tree | d2f8d353ebf2ffb80c72de943a6ab810fd773261 /ufund-api/src/main/java/com/ufund | |
| parent | 26b4a37cb91dfe5551f3e227512cd5ceff897d54 (diff) | |
| download | JellySolutions-75f5ad5fb154811d7acd236687bb7f30bb7c10aa.tar.gz JellySolutions-75f5ad5fb154811d7acd236687bb7f30bb7c10aa.tar.bz2 JellySolutions-75f5ad5fb154811d7acd236687bb7f30bb7c10aa.zip  | |
Fixed incognito race condition and checkout bugs
Diffstat (limited to 'ufund-api/src/main/java/com/ufund')
| -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);  | 
