diff --git a/resources/views/system/holidays/index.blade.php b/resources/views/system/holidays/index.blade.php index b7faed7d..081b66a9 100644 --- a/resources/views/system/holidays/index.blade.php +++ b/resources/views/system/holidays/index.blade.php @@ -183,11 +183,13 @@ function HolidayManagement() { const handleDeleteYear = async () => { if (!confirm(`${selectedYear}년도의 모든 휴일(${totalHolidays}건)을 삭제하시겠습니까?\n\n이 작업은 되돌릴 수 없습니다.`)) return; try { - const url = `/system/holidays/year/${selectedYear}`; - console.log('[DEBUG] Delete year URL:', url, 'selectedYear:', selectedYear); - const res = await fetch(url, { - method: 'DELETE', - headers: { 'X-CSRF-TOKEN': csrfToken }, + const res = await fetch('/system/holidays/destroy-year', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-CSRF-TOKEN': csrfToken, + }, + body: JSON.stringify({ year: selectedYear }), }); const data = await res.json(); if (res.ok) { diff --git a/routes/web.php b/routes/web.php index 4bbda25e..0bfb8675 100644 --- a/routes/web.php +++ b/routes/web.php @@ -399,7 +399,7 @@ Route::get('/list', [HolidayController::class, 'list'])->name('list'); Route::post('/', [HolidayController::class, 'store'])->name('store'); Route::post('/bulk', [HolidayController::class, 'bulkStore'])->name('bulk'); - Route::delete('/year/{year}', [HolidayController::class, 'destroyByYear'])->name('destroy-year'); + Route::post('/destroy-year', [HolidayController::class, 'destroyByYear'])->name('destroy-year'); Route::put('/{id}', [HolidayController::class, 'update'])->name('update'); Route::delete('/{id}', [HolidayController::class, 'destroy'])->name('destroy'); });