Skip to content

Commit

Permalink
refactor: 삭제 시, 삭제여부 확인하는 절차 추가
Browse files Browse the repository at this point in the history
  - Kernel360#138 이슈에 명시된 바와 같이, 도서/독후감/댓글 삭제 시, 삭제할 것인지 물어보는 절차를 추가했습니다.
  • Loading branch information
GBGreenBravo committed Nov 21, 2023
1 parent 094ff4e commit 5d4c83b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/resources/templates/book/admin/books.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
<body>
<script>
async function deleteBook(bookId) {
const confirmed = confirm('정말로 이 도서를 삭제하시겠습니까?');

if (!confirmed) {
return;
}

// JSON 데이터를 생성
let data = {
id: bookId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
</style>
<script type="text/javascript">
async function deleteBookReport() {
const confirmed = confirm('정말로 이 독후감을 삭제하시겠습니까?');

if (!confirmed) {
return;
}

let data = {
id: document.getElementById('id').value
};
Expand Down
12 changes: 12 additions & 0 deletions src/main/resources/templates/bookreport/book-report-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@
}

async function deleteBookReport(bookReportId) {
const confirmed = confirm('정말로 이 독후감을 삭제하시겠습니까?');

if (!confirmed) {
return;
}

// JSON 데이터를 생성
let data = {
id: bookReportId
Expand Down Expand Up @@ -114,6 +120,12 @@
}

async function deleteReply(replyId) {
const confirmed = confirm('정말로 이 댓글을 삭제하시겠습니까?');

if (!confirmed) {
return;
}

// JSON 데이터를 생성
let data = {
id: replyId
Expand Down

0 comments on commit 5d4c83b

Please sign in to comment.