aboutsummaryrefslogtreecommitdiff
path: root/ufund-api
diff options
context:
space:
mode:
authorGunther6070 <haydenhartman10@yahoo.com>2025-03-17 22:20:02 -0400
committerGunther6070 <haydenhartman10@yahoo.com>2025-03-17 22:20:02 -0400
commitd4c0487021b75d94cbb76dcb5c97c344468ba9e5 (patch)
tree9dfc7507137af9a2508b18358b55251b8328ec2c /ufund-api
parent839a237029b66ba9e45fb0bf15097283eec23f12 (diff)
downloadJellySolutions-d4c0487021b75d94cbb76dcb5c97c344468ba9e5.tar.gz
JellySolutions-d4c0487021b75d94cbb76dcb5c97c344468ba9e5.tar.bz2
JellySolutions-d4c0487021b75d94cbb76dcb5c97c344468ba9e5.zip
Added check to update to check for less than 1 values
Diffstat (limited to 'ufund-api')
-rw-r--r--ufund-api/src/main/java/com/ufund/api/ufundapi/service/CupboardService.java3
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);
}