aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}