fix: robust handling of non-array responses in scaffold.html dropdowns
Some checks failed
Deploy to OCIWP / deploy (push) Failing after 26s
Some checks failed
Deploy to OCIWP / deploy (push) Failing after 26s
This commit is contained in:
@@ -1703,7 +1703,12 @@
|
||||
const response = await fetch(`/api/v1/scaffold/usecases?moduleName=${encodeURIComponent(moduleName)}&categoryKey=${encodeURIComponent(categoryKey)}&workspacePath=${encodeURIComponent(workspacePath)}`);
|
||||
if (!response.ok) throw new Error('UseCase 목록 조회 실패');
|
||||
const useCases = await response.json();
|
||||
useCases.forEach(useCaseName => select.add(new Option(`기존 ${useCaseName}에 함수 추가`, useCaseName)));
|
||||
if (Array.isArray(useCases)) {
|
||||
useCases.forEach(useCaseName => select.add(new Option(`기존 ${useCaseName}에 함수 추가`, useCaseName)));
|
||||
} else {
|
||||
console.error('API Error:', useCases);
|
||||
alert('서버 응답 오류 (UseCase): 배열이 아닙니다.\n\n' + JSON.stringify(useCases, null, 2));
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn(error);
|
||||
}
|
||||
@@ -1719,7 +1724,12 @@
|
||||
const response = await fetch(`/api/v1/scaffold/categories?moduleName=${encodeURIComponent(moduleName)}&workspacePath=${encodeURIComponent(workspacePath)}`);
|
||||
if (!response.ok) throw new Error('Category 목록 조회 실패');
|
||||
const categories = await response.json();
|
||||
categories.forEach(cat => select.add(new Option(`기존 ${cat} 도메인`, cat)));
|
||||
if (Array.isArray(categories)) {
|
||||
categories.forEach(cat => select.add(new Option(`기존 ${cat} 도메인`, cat)));
|
||||
} else {
|
||||
console.error('API Error:', categories);
|
||||
alert('서버 응답 오류 (Category): 배열이 아닙니다.\n\n' + JSON.stringify(categories, null, 2));
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user