develop #5

Merged
Petr merged 5 commits from develop into master 2025-02-20 07:49:29 +00:00
2 changed files with 7 additions and 6 deletions
Showing only changes of commit c76f57da93 - Show all commits

View File

@ -42,9 +42,10 @@ public class OfficeController {
return ResponseEntity.ok(officeService.update(officeId, officeDTO));
}
@DeleteMapping("/{officeId}")
public ResponseEntity<Void> deleteOffice(@PathVariable long officeId) {
officeService.delete(officeId);
return ResponseEntity.noContent().build();
}
// Тут баг с ссылочной целостностью
// @DeleteMapping("/{officeId}")
// public ResponseEntity<Void> deleteOffice(@PathVariable long officeId) {
// officeService.delete(officeId);
// return ResponseEntity.noContent().build();
// }
}

View File

@ -39,7 +39,7 @@ public class Terminal {
private String code;
// todo: Протестировать нужен ли тут каскад тип
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "office_id", nullable = false)
private Office office;