관리페이지 데이터 전송 오류 메세지 표시1
Deploy EG-BIM QA Gateway / deploy (push) Successful in 57s

This commit is contained in:
root
2026-09-21 15:13:32 +09:00
parent 50a540ed02
commit cb36c6e89f
5 changed files with 13 additions and 5 deletions
+9 -1
View File
@@ -166,7 +166,10 @@
function bindGlobal() {
renderAuth(getAuthUser());
authReady = loadAuthUser().then(function (user) { renderAuth(user); return user; });
authReady = loadAuthUser().catch(function (error) {
console.error('[QA] SSO session load failed:', error);
return getAuthUser();
}).then(function (user) { renderAuth(user); return user; });
const menuButton = qs('.menu-button');
const nav = qs('.global-nav');
if (menuButton && nav) {
@@ -317,8 +320,10 @@
}
form.addEventListener('submit', async function (event) {
event.preventDefault();
console.info('[QA] feedback submit started');
errorBox.style.display = 'none';
const currentUser = await (authReady || Promise.resolve(getAuthUser()));
console.info('[QA] SSO user resolved:', Boolean(currentUser), currentUser ? { hasRequesterId: Boolean(currentUser.requesterId), hasTenantId: Boolean(currentUser.requesterTenantId), hasPhone: Boolean(currentUser.phone) } : null);
if (!currentUser) { errorBox.textContent = '로그인 후 문의를 등록할 수 있습니다.'; errorBox.style.display = 'block'; return; }
if (!currentUser.requesterId || !currentUser.requesterTenantId) { errorBox.textContent = 'SSO에서 작성자 UUID와 테넌트 정보를 확인하지 못했습니다. 다시 로그인한 뒤 시도해주세요.'; errorBox.style.display = 'block'; return; }
const title = qs('#title').value.trim();
@@ -333,12 +338,15 @@
try {
const attachments = await uploadFiles(qs('#attachment').files, feedbackId, 'FEEDBACK_ATTACHMENT');
const payload = buildFeedbackPayload(post, currentUser, feedbackId, attachments);
console.info('[QA] sending feedback to Worker:', config.createFeedbackPath);
const result = await postToApi(config.createFeedbackPath, payload);
console.info('[QA] Worker feedback response:', result);
post.id = result.id || post.id;
savePost(post);
showToast(result.local ? '테스트 글로 저장했습니다. UUID가 생성되었습니다.' : '문의가 등록되었습니다.');
window.setTimeout(function () { window.location.href = 'detail.html?id=' + encodeURIComponent(post.id); }, 500);
} catch (error) {
console.error('[QA] feedback submit failed:', error);
errorBox.textContent = error.message || '등록 중 오류가 발생했습니다.';
errorBox.style.display = 'block';
submitButton.disabled = false;