Fix: Excel upload logic, field mapping for servers, and date format synchronization
This commit is contained in:
@@ -210,12 +210,22 @@ async function confirmUpload() {
|
||||
else if (tab === '도메인') endpoint = `${API_BASE}/api/ops/domain/batch`;
|
||||
|
||||
if (endpoint) {
|
||||
const response = await fetch(endpoint, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
if (response.ok) successCount++;
|
||||
try {
|
||||
const response = await fetch(endpoint, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
if (response.ok) {
|
||||
successCount++;
|
||||
} else {
|
||||
const errRes = await response.json();
|
||||
throw new Error(`[${tab}] ${errRes.error || '저장 실패'}`);
|
||||
}
|
||||
} catch (e: any) {
|
||||
alert(`카테고리 '${tab}' 저장 중 오류: ${e.message}`);
|
||||
throw e; // Stop processing further tabs
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +238,7 @@ async function confirmUpload() {
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
alert('업로드 중 오류가 발생했습니다.');
|
||||
// 상세 에러는 내부 catch에서 이미 alert으로 띄움
|
||||
} finally {
|
||||
if (confirmBtn) {
|
||||
confirmBtn.disabled = false;
|
||||
@@ -274,7 +284,7 @@ async function generateBulkCodes() {
|
||||
for (const prefix in groups) {
|
||||
const rows = groups[prefix];
|
||||
// Fetch current next code for this prefix
|
||||
const res = await fetch(`http://172.16.40.100:3000/api/generate-asset-code?prefix=${prefix}`);
|
||||
const res = await fetch(`http://${location.hostname}:3000/api/generate-asset-code?prefix=${prefix}`);
|
||||
const result = await res.json();
|
||||
if (result.nextCode) {
|
||||
let baseNum = parseInt(result.nextCode.replace(prefix, ''));
|
||||
|
||||
Reference in New Issue
Block a user