From 6edd6c155819e8189b7b3af68261903b0ce56c58 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Wed, 8 Jan 2025 15:25:31 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=A4=EB=94=94=EC=85=98=20=EC=A7=80?= =?UTF-8?q?=EC=9B=90=20=EC=B7=A8=EC=86=8C=EA=B8=B0=EB=8A=A5=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/audition.js | 7 +- src/views/Audition/AuditionRoleDetailView.vue | 77 +++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) diff --git a/src/api/audition.js b/src/api/audition.js index 7df4cd2..d9b850a 100644 --- a/src/api/audition.js +++ b/src/api/audition.js @@ -48,7 +48,12 @@ async function getAuditionApplicantList(id, page) { return Vue.axios.get("/admin/audition/role/" + id + "/applicant?page=" + (page - 1) + "&size=20"); } +async function deleteAuditionApplicant(id) { + return Vue.axios.delete("/admin/audition/applicant/" + id); +} + export { getAuditionList, createAudition, updateAudition, getAuditionDetail, - createAuditionRole, updateAuditionRole, getAuditionRoleDetail, getAuditionApplicantList + createAuditionRole, updateAuditionRole, getAuditionRoleDetail, getAuditionApplicantList, + deleteAuditionApplicant } diff --git a/src/views/Audition/AuditionRoleDetailView.vue b/src/views/Audition/AuditionRoleDetailView.vue index 94d5997..2739429 100644 --- a/src/views/Audition/AuditionRoleDetailView.vue +++ b/src/views/Audition/AuditionRoleDetailView.vue @@ -63,6 +63,9 @@ 추천수 + + 관리 + @@ -95,6 +98,14 @@ /> {{ item.voteCount }} + + + 삭제 + + @@ -114,6 +125,36 @@ + + + + + + "{{ selected_audition_role_applicant.nickname }}"님의 오디션지원을 취소하시겠습니까? + + + + + 취소 + + + 확인 + + + + @@ -138,6 +179,9 @@ export default { audition_role_detail: {}, audition_role_applicant_list: [], + selected_audition_role_applicant: {}, + show_delete_confirm_dialog: false, + page: 1, total_page: 0, } @@ -164,6 +208,16 @@ export default { this.$dialog.notify.success(message) }, + deleteConfirm(item) { + this.selected_audition_role_applicant = item + this.show_delete_confirm_dialog = true + }, + + deleteCancel() { + this.selected_audition_role_applicant = {} + this.show_delete_confirm_dialog = false + }, + isValidUrl(string) { try { new URL(string); // URL 생성 시 예외가 발생하면 유효하지 않은 URL @@ -236,6 +290,29 @@ export default { async next() { await this.getAuditionRoleApplicant() }, + + async deleteAuditionApplicant() { + if (this.is_loading) return; + this.is_loading = true + + try { + const res = await api.deleteAuditionApplicant(this.selected_audition_role_applicant.applicantId) + if (res.status === 200 && res.data.success === true) { + this.show_delete_confirm_dialog = false + this.notifySuccess(res.data.message || '오디션 지원이 취소 되었습니다.') + + this.audition_role_applicant_list = [] + this.page = 1 + await this.getAuditionRoleApplicant() + } else { + this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') + } + } catch (e) { + this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.') + } finally { + this.is_loading = false + } + }, } }