fix: fix bugs OfficeController and Terminal
This commit is contained in:
parent
fa27254abf
commit
c76f57da93
@ -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();
|
||||
// }
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user