fix: remove role from global org registry — role is deal-specific, not org-level

This commit is contained in:
James 2026-03-17 21:25:36 -04:00
parent 412f9f7b12
commit 06ff5268ba
1 changed files with 8 additions and 22 deletions

View File

@ -27,10 +27,7 @@
<div><label class="block text-sm font-medium text-[#b0bec5] mb-1.5">Email Domains <span class="text-red-400">*</span></label>
<input id="oDomains" type="text" placeholder="blackstone.com" class="w-full px-4 py-2.5 bg-[#0a1628] border border-white/[0.08] rounded-lg text-white placeholder-[#8899a6] focus:outline-none focus:border-[#c9a84c]">
<p class="text-[#8899a6] text-xs mt-1">Comma-separated. Used to validate invite emails.</p></div>
<div><label class="block text-sm font-medium text-[#b0bec5] mb-1.5">Role</label>
<select id="oRole" class="w-full px-4 py-2.5 bg-[#0a1628] border border-white/[0.08] rounded-lg text-white focus:outline-none focus:border-[#c9a84c]">
<option value="seller">Seller</option><option value="buyer">Buyer</option><option value="ib">IB Advisor</option><option value="advisor">Advisor</option>
</select></div>
<div><label class="block text-sm font-medium text-[#b0bec5] mb-1.5">Website</label>
<input id="oWebsite" type="text" placeholder="blackstone.com" class="w-full px-4 py-2.5 bg-[#0a1628] border border-white/[0.08] rounded-lg text-white placeholder-[#8899a6] focus:outline-none focus:border-[#c9a84c]"></div>
</div>
@ -66,12 +63,7 @@
<label class="block text-xs text-[#b0bec5] mb-1">Description</label>
<textarea id="eDesc" rows="3" class="w-full px-3 py-2 bg-[#0a1628] border border-white/[0.08] rounded-lg text-white text-sm focus:outline-none focus:border-[#c9a84c] resize-none"></textarea>
</div>
<div>
<label class="block text-xs text-[#b0bec5] mb-1">Role</label>
<select id="eRole" class="w-full px-3 py-2 bg-[#0a1628] border border-white/[0.08] rounded-lg text-white text-sm focus:outline-none focus:border-[#c9a84c]">
<option value="seller">Seller</option><option value="buyer">Buyer</option><option value="ib">IB Advisor</option><option value="advisor">Advisor</option>
</select>
</div>
<div>
<label class="block text-xs text-[#b0bec5] mb-1">Industry</label>
<input id="eIndustry" type="text" class="w-full px-3 py-2 bg-[#0a1628] border border-white/[0.08] rounded-lg text-white text-sm focus:outline-none focus:border-[#c9a84c]">
@ -170,18 +162,13 @@
grid.innerHTML = orgs.map(o => {
const name = o.name || 'Untitled';
const role = o.role || '';
const rc = roleColors[role] || 'bg-gray-500/20 text-gray-300';
const domains = Array.isArray(o.domains) ? o.domains : (o.domains ? [o.domains] : []);
const logo = o.logo || '';
return `<div onclick="openEditModal('${o.entry_id}')"
class="bg-[#0d1f3c] border border-white/[0.08] rounded-xl p-5 cursor-pointer hover:border-white/[0.2] transition">
<div class="flex items-start justify-between gap-3 mb-3">
<div class="flex items-center gap-3 min-w-0">
${logo ? `<div class="w-10 h-10 rounded-lg border border-white/[0.08] overflow-hidden bg-white shrink-0 flex items-center justify-center"><img src="${escHtml(logo)}" class="max-w-full max-h-full object-contain" onerror="this.parentElement.style.display='none'"></div>` : ''}
<h3 class="text-white font-semibold leading-tight truncate">${escHtml(name)}</h3>
</div>
<span class="shrink-0 px-2 py-0.5 rounded-full text-xs font-medium capitalize ${rc}">${role || '—'}</span>
<div class="flex items-start gap-3 mb-3">
${logo ? `<div class="w-10 h-10 rounded-lg border border-white/[0.08] overflow-hidden bg-white shrink-0 flex items-center justify-center"><img src="${escHtml(logo)}" class="max-w-full max-h-full object-contain" onerror="this.parentElement.style.display='none'"></div>` : ''}
<h3 class="text-white font-semibold leading-tight truncate">${escHtml(name)}</h3>
</div>
${o.description ? `<p class="text-xs text-[#94a3b8] mb-2 line-clamp-2">${escHtml(o.description)}</p>` : ''}
<div class="flex gap-1.5 flex-wrap">${domains.map(dm => `<span class="text-xs font-mono text-[#b0bec5] bg-white/[0.05] px-2 py-0.5 rounded">@${escHtml(dm)}</span>`).join('')}</div>
@ -201,7 +188,6 @@
async function createOrg() {
const name = document.getElementById('oName').value.trim();
const domainsRaw = document.getElementById('oDomains').value.trim();
const role = document.getElementById('oRole').value;
const website = document.getElementById('oWebsite').value.trim().replace(/^https?:\/\//, '');
const errEl = document.getElementById('modalError');
const btn = document.getElementById('createBtn');
@ -210,7 +196,7 @@
const domains = domainsRaw.split(',').map(d => d.trim().replace(/^@/, '')).filter(Boolean);
btn.disabled = true; btn.textContent = 'Creating...'; errEl.classList.add('hidden');
try {
const res = await fetchAPI('/api/orgs', { method: 'POST', body: JSON.stringify({ name, domains, role, website }) });
const res = await fetchAPI('/api/orgs', { method: 'POST', body: JSON.stringify({ name, domains, website }) });
const data = await res.json();
if (!res.ok) throw new Error(data.error || 'Failed');
closeModal();
@ -230,7 +216,7 @@
document.getElementById('eVersion').value = o.version || 1;
document.getElementById('eName').value = o.name || '';
document.getElementById('eDesc').value = o.description || '';
document.getElementById('eRole').value = o.role || 'seller';
document.getElementById('eIndustry').value = o.industry || '';
document.getElementById('eWebsite').value = o.website || '';
document.getElementById('ePhone').value = o.phone || '';
@ -280,7 +266,7 @@
body: JSON.stringify({
name,
domains,
role: document.getElementById('eRole').value,
description: document.getElementById('eDesc').value.trim(),
industry: document.getElementById('eIndustry').value.trim(),
website: document.getElementById('eWebsite').value.trim(),