Skip to content

Commit 2dabb59

Browse files
feat: added @Valid in some dtos
1 parent 68e1ab3 commit 2dabb59

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

techchallenge/src/main/java/br/com/grupo63/techchallenge/adapter/in/controller/client/ClientController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public ResponseEntity<List<ClientDTO>> list() {
6363
summary = "Atualizar cliente",
6464
description = "Atualiza um cliente por id com os dados enviados")
6565
@PutMapping("/{id}")
66-
public ResponseEntity<ClientDTO> update(@RequestBody ClientDTO dto, @PathVariable("id") Long id) throws NotFoundException {
66+
public ResponseEntity<ClientDTO> update(@Valid @RequestBody ClientDTO dto, @PathVariable("id") Long id) throws NotFoundException {
6767
return ResponseEntity.ok(useCase.update(dto, id));
6868
}
6969

techchallenge/src/main/java/br/com/grupo63/techchallenge/adapter/in/controller/product/ProductController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public ResponseEntity<List<ProductDTO>> list() {
6464
summary = "Atualizar produto",
6565
description = "Atualiza um produto por id com os dados enviados")
6666
@PutMapping("/{id}")
67-
public ResponseEntity<ProductDTO> update(@RequestBody ProductDTO dto, @PathVariable("id") Long id) throws NotFoundException {
67+
public ResponseEntity<ProductDTO> update(@Valid @RequestBody ProductDTO dto, @PathVariable("id") Long id) throws NotFoundException {
6868
return ResponseEntity.ok(useCase.update(dto, id));
6969
}
7070

0 commit comments

Comments
 (0)