From 74d406fceb522ff4f27293f4e1670a5b07a3e46c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Wed, 4 Mar 2026 23:09:14 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[leaves]=20=ED=9C=B4=EA=B0=80=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=EC=82=AD=EC=A0=9C/=EC=98=81=EA=B5=AC=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=ED=95=A8=EC=88=98=20=EB=88=84=EB=9D=BD=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/hr/leaves/index.blade.php | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/resources/views/hr/leaves/index.blade.php b/resources/views/hr/leaves/index.blade.php index e6948fc8..e866475a 100644 --- a/resources/views/hr/leaves/index.blade.php +++ b/resources/views/hr/leaves/index.blade.php @@ -756,6 +756,50 @@ function cancelLeave(id) { .catch(() => showToast('네트워크 오류가 발생했습니다.', 'error')); } + function deleteLeave(id) { + if (!confirm('삭제하시겠습니까?')) return; + + fetch('{{ url("/api/admin/hr/leaves") }}/' + id, { + method: 'DELETE', + headers: { + 'Accept': 'application/json', + 'X-CSRF-TOKEN': '{{ csrf_token() }}' + } + }) + .then(r => r.json()) + .then(res => { + if (res.success) { + refreshTable(); + showToast(res.message, 'success'); + } else { + showToast(res.message || '삭제 실패', 'error'); + } + }) + .catch(() => showToast('네트워크 오류가 발생했습니다.', 'error')); + } + + function forceDeleteLeave(id) { + if (!confirm('영구 삭제하시겠습니까?\n이 작업은 되돌릴 수 없으며, 연결된 결재 기록도 함께 삭제됩니다.')) return; + + fetch('{{ url("/api/admin/hr/leaves") }}/' + id + '?force=1', { + method: 'DELETE', + headers: { + 'Accept': 'application/json', + 'X-CSRF-TOKEN': '{{ csrf_token() }}' + } + }) + .then(r => r.json()) + .then(res => { + if (res.success) { + refreshTable(); + showToast(res.message, 'success'); + } else { + showToast(res.message || '영구 삭제 실패', 'error'); + } + }) + .catch(() => showToast('네트워크 오류가 발생했습니다.', 'error')); + } + // ===== 토스트 ===== function showToast(message, type) { if (typeof window.showToastNotification === 'function') {