jpablog : delete post cascade

This commit is contained in:
kim
2021-02-02 15:02:51 +09:00
parent 62c665b9f3
commit a1cac3e0d8
2 changed files with 7 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ public class Board {
@JoinColumn(name = "user_id")
private User user;
@OneToMany(mappedBy = "board")
@OneToMany(mappedBy = "board", cascade = CascadeType.REMOVE)
@JsonIgnoreProperties({"board"})
@OrderBy("id desc")
private List<Reply> replies = new ArrayList<>();

View File

@@ -20,8 +20,12 @@ let index = {
contentType: "application/json; charset=utf-8",
dataType: "json"
}).done(function (resp){
console.log(resp);
alert("회원가입이 완료되었습니다.");
if (resp.statusCode === 500) {
alert("회원가입 실패.");
} else {
alert("회원가입 완료.");
}
location.href = "/";
}).fail(function (error){
alert(JSON.stringify(error));