fix:휴일 년도별 삭제 POST 방식으로 변경
- DELETE /year/{year} → POST /destroy-year 변경
- JavaScript fetch도 POST + JSON body 방식으로 변경
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user