This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user