Better implementation of updates for notice and client

This commit is contained in:
2025-04-14 09:39:14 +02:00
parent 4fa138203d
commit b0f47b475a
4 changed files with 47 additions and 19 deletions

View File

@@ -15,7 +15,7 @@ import java.util.List;
public class ClientController {
private final ClientService clientService;
public ClientController(ClientService clientService, ClientRepository clientRepository) {
public ClientController(ClientService clientService) {
this.clientService = clientService;
}
@@ -28,7 +28,7 @@ public class ClientController {
@PutMapping("/edit/{id}")
public ResponseEntity updateClient(@PathVariable("id") long id, @RequestBody ClientDTO clientDTO) {
if(clientService.clientExists(id)) {
return new ResponseEntity<>(clientService.updateClient(clientDTO),HttpStatus.OK);
return new ResponseEntity<>(clientService.updateClient(id, clientDTO),HttpStatus.OK);
} else {
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}