fix: [hr] 통합 근태관리 JS API URL에 /api 접두사 추가

This commit is contained in:
김보곤
2026-03-04 00:02:40 +09:00
parent 36add4d889
commit 092bcbd66c

View File

@@ -129,14 +129,14 @@ function loadAttendances(page) {
if (to) params.set('date_to', to);
if (page) params.set('page', page);
htmx.ajax('GET', '/admin/hr/attendances?' + params.toString(), {
htmx.ajax('GET', '/api/admin/hr/attendances?' + params.toString(), {
target: '#attendance-table-container',
swap: 'innerHTML'
});
}
function loadAttendanceStats(year, month) {
htmx.ajax('GET', '/admin/hr/attendances/stats?year=' + year + '&month=' + month, {
htmx.ajax('GET', '/api/admin/hr/attendances/stats?year=' + year + '&month=' + month, {
target: '#attendance-stats-container',
swap: 'innerHTML'
});
@@ -160,7 +160,7 @@ function loadRequests(page) {
if (to) params.set('date_to', to);
if (page) params.set('page', page);
htmx.ajax('GET', '/admin/hr/leaves?' + params.toString(), {
htmx.ajax('GET', '/api/admin/hr/leaves?' + params.toString(), {
target: '#requests-table-container',
swap: 'innerHTML'
});
@@ -171,7 +171,7 @@ function loadRequests(page) {
// =========================================================================
function loadBalance() {
const year = document.getElementById('balance-year')?.value || new Date().getFullYear();
htmx.ajax('GET', '/admin/hr/leaves/balance?year=' + year, {
htmx.ajax('GET', '/api/admin/hr/leaves/balance?year=' + year, {
target: '#balance-table-container',
swap: 'innerHTML'
});
@@ -237,7 +237,7 @@ function onUserChange() {
if (!userId) return;
// 잔여연차 조회
fetch('/admin/hr/leaves/balance/' + userId)
fetch('/api/admin/hr/leaves/balance/' + userId)
.then(r => r.json())
.then(data => {
if (data.success && data.data) {
@@ -269,7 +269,7 @@ function submitLeave() {
approval_line_id: document.getElementById('modal-approval-line')?.value || null,
};
fetch('/admin/hr/leaves', {
fetch('/api/admin/hr/leaves', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -295,7 +295,7 @@ function submitLeave() {
function cancelLeave(id) {
if (!confirm('신청을 취소하시겠습니까? 승인된 건은 연차가 복원됩니다.')) return;
fetch('/admin/hr/leaves/' + id + '/cancel', {
fetch('/api/admin/hr/leaves/' + id + '/cancel', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -317,7 +317,7 @@ function cancelLeave(id) {
function deleteLeave(id) {
if (!confirm('신청을 삭제하시겠습니까?')) return;
fetch('/admin/hr/leaves/' + id, {
fetch('/api/admin/hr/leaves/' + id, {
method: 'DELETE',
headers: {
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,