fix: Use absolute API paths in upload modal and fix cloud endpoint

This commit is contained in:
2026-04-23 20:34:56 +09:00
parent dde3aefaac
commit d7af75976e

View File

@@ -198,15 +198,16 @@ async function confirmUpload() {
const data = parsedData[tab]; const data = parsedData[tab];
let endpoint = ''; let endpoint = '';
if (tab === '개인PC') endpoint = '/api/pc/batch'; const API_BASE = `http://${location.hostname}:3000`;
else if (tab === '서버') endpoint = '/api/server/batch'; if (tab === '개인PC') endpoint = `${API_BASE}/api/pc/batch`;
else if (tab === '스토리지') endpoint = '/api/storage/batch'; else if (tab === '서버') endpoint = `${API_BASE}/api/server/batch`;
else if (tab === '전산비품') endpoint = '/api/equip/batch'; else if (tab === '스토리지') endpoint = `${API_BASE}/api/storage/batch`;
else if (tab === '모바일기기') endpoint = '/api/mobile/batch'; else if (tab === '전산비품') endpoint = `${API_BASE}/api/equip/batch`;
else if (tab === '구독SW') endpoint = '/api/sw/sub/batch'; else if (tab === '모바일기기') endpoint = `${API_BASE}/api/mobile/batch`;
else if (tab === '구SW') endpoint = '/api/sw/perm/batch'; else if (tab === '구SW') endpoint = `${API_BASE}/api/sw/sub/batch`;
else if (tab === '클라우드') endpoint = '/api/sw/cloud/batch'; else if (tab === '영구SW') endpoint = `${API_BASE}/api/sw/perm/batch`;
else if (tab === '도메인') endpoint = '/api/ops/domain/batch'; else if (tab === '클라우드') endpoint = `${API_BASE}/api/cloud/batch`;
else if (tab === '도메인') endpoint = `${API_BASE}/api/ops/domain/batch`;
if (endpoint) { if (endpoint) {
const response = await fetch(endpoint, { const response = await fetch(endpoint, {