aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/main/java
diff options
context:
space:
mode:
authorGunther6070 <haydenhartman10@yahoo.com>2025-03-18 13:35:09 -0400
committerGunther6070 <haydenhartman10@yahoo.com>2025-03-18 13:35:09 -0400
commitc135f56c7b2d0d283ea279fa7934929fb2e09aa3 (patch)
tree58197052310b6ea7efdcd218ceb50101c1b7101f /ufund-api/src/main/java
parent72868a3b4026bc8d5c8484487e62027de3baf0bc (diff)
downloadJellySolutions-c135f56c7b2d0d283ea279fa7934929fb2e09aa3.tar.gz
JellySolutions-c135f56c7b2d0d283ea279fa7934929fb2e09aa3.tar.bz2
JellySolutions-c135f56c7b2d0d283ea279fa7934929fb2e09aa3.zip
Modified status codes to properly display error messages on creation and updating of needs
Diffstat (limited to 'ufund-api/src/main/java')
-rw-r--r--ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java4
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 9592490..6356fd9 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
@@ -17,10 +17,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
+import com.ufund.api.ufundapi.DuplicateKeyException;
import com.ufund.api.ufundapi.model.Need;
import com.ufund.api.ufundapi.model.Need.GoalType;
import com.ufund.api.ufundapi.service.CupboardService;
-import com.ufund.api.ufundapi.DuplicateKeyException;
@RestController
@RequestMapping("cupboard")
@@ -59,7 +59,7 @@ public class CupboardController {
} catch (DuplicateKeyException ex) {
return new ResponseEntity<>(HttpStatus.CONFLICT);
} catch (IllegalArgumentException ex) {
- return new ResponseEntity<>(HttpStatus.UNPROCESSABLE_ENTITY);
+ return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
} catch (IOException ex) {
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}