diff options
author | Gunther6070 <haydenhartman10@yahoo.com> | 2025-03-17 22:20:02 -0400 |
---|---|---|
committer | Gunther6070 <haydenhartman10@yahoo.com> | 2025-03-17 22:20:02 -0400 |
commit | d4c0487021b75d94cbb76dcb5c97c344468ba9e5 (patch) | |
tree | 9dfc7507137af9a2508b18358b55251b8328ec2c | |
parent | 839a237029b66ba9e45fb0bf15097283eec23f12 (diff) | |
download | JellySolutions-d4c0487021b75d94cbb76dcb5c97c344468ba9e5.tar.gz JellySolutions-d4c0487021b75d94cbb76dcb5c97c344468ba9e5.tar.bz2 JellySolutions-d4c0487021b75d94cbb76dcb5c97c344468ba9e5.zip |
Added check to update to check for less than 1 values
-rw-r--r-- | ufund-api/src/main/java/com/ufund/api/ufundapi/service/CupboardService.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/service/CupboardService.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/service/CupboardService.java index 78f8f85..2398745 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/service/CupboardService.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/service/CupboardService.java @@ -90,6 +90,9 @@ public class CupboardService { if (need.getId() != id) { throw new IllegalArgumentException("ID in URL and body must match"); } + if (need.getMaxGoal() <= 0) { + throw new IllegalArgumentException("Goal must be greater than 0"); + } return cupboardDAO.updateNeed(need); } |