File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
src/main/java/com/answerdigital/answerking/controller Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ public CategoryController(final CategoryService categoryService) {
4545 public ResponseEntity <Category > addCategory (@ Valid @ RequestBody final AddCategoryRequest categoryRequest ,
4646 final Errors errors ) {
4747 return new ResponseEntity <>(categoryService .addCategory (categoryRequest ),
48- errors .hasErrors () ? HttpStatus .BAD_REQUEST : HttpStatus .OK );
48+ errors .hasErrors () ? HttpStatus .BAD_REQUEST : HttpStatus .CREATED );
4949 }
5050
5151 @ Operation (summary = "Get all categories." )
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public ResponseEntity<Product> getProductById(@Valid @PathVariable @NotNull fina
4848 @ PostMapping
4949 public ResponseEntity <Product > addProduct (@ Valid @ RequestBody final ProductRequest productRequest , final Errors errors ) {
5050 return new ResponseEntity <>(productService .addNewProduct (productRequest ),
51- errors .hasErrors () ? HttpStatus .BAD_REQUEST : HttpStatus .OK );
51+ errors .hasErrors () ? HttpStatus .BAD_REQUEST : HttpStatus .CREATED );
5252 }
5353
5454 @ PutMapping ("/{id}" )
You can’t perform that action at this time.
0 commit comments