fix: 협력업체 목록 안 뜨는 버그 수정 — c.name → c.company_name
partner_companies 테이블 컬럼명은 company_name인데 JS에서 c.name으로 접근하여 undefined가 반환되던 문제. accounts/schedule/workreport 3개 파일 6곳 수정. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,21 +23,21 @@ function renderCompanyList(list) {
|
||||
container.innerHTML = list.map(c => {
|
||||
const active = c.id === selectedCompanyId;
|
||||
return `<button onclick="selectCompanyForAccounts(${c.id})" class="w-full text-left px-3 py-2 rounded-lg text-sm transition-colors ${active ? 'bg-emerald-50 text-emerald-700 font-medium' : 'text-gray-700 hover:bg-gray-50'}">
|
||||
<i class="fas fa-building mr-2 ${active ? 'text-emerald-500' : 'text-gray-400'}"></i>${escapeHtml(c.name)}
|
||||
<i class="fas fa-building mr-2 ${active ? 'text-emerald-500' : 'text-gray-400'}"></i>${escapeHtml(c.company_name)}
|
||||
</button>`;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
function filterCompanyList() {
|
||||
const q = document.getElementById('companyFilter').value.trim().toLowerCase();
|
||||
const filtered = q ? allCompanies.filter(c => (c.name || '').toLowerCase().includes(q)) : allCompanies;
|
||||
const filtered = q ? allCompanies.filter(c => (c.company_name || '').toLowerCase().includes(q)) : allCompanies;
|
||||
renderCompanyList(filtered);
|
||||
}
|
||||
|
||||
async function selectCompanyForAccounts(id) {
|
||||
selectedCompanyId = id;
|
||||
const company = allCompanies.find(c => c.id === id);
|
||||
document.getElementById('selectedCompanyName').textContent = company ? company.name + ' - 계정 목록' : '계정 목록';
|
||||
document.getElementById('selectedCompanyName').textContent = company ? company.company_name + ' - 계정 목록' : '계정 목록';
|
||||
document.getElementById('addAccountBtn').classList.remove('hidden');
|
||||
|
||||
// Re-render company list to highlight selection
|
||||
|
||||
Reference in New Issue
Block a user