Actualizar proveedores.html

This commit is contained in:
2026-03-14 16:39:03 +00:00
parent 2b8e8c2d50
commit c7391dfc94

View File

@@ -370,14 +370,19 @@
} catch(e) {}
}
async function loadOpsForGuild(guildId) {
async function loadOpsForGuild(guildId) {
const sel = document.getElementById('impOperator');
if(!guildId) { sel.innerHTML = '<option value="">-- Automática --</option>'; return; }
if(!guildId) {
sel.innerHTML = '<option value="">-- Automática --</option>';
filterStatusOptions(); // <--- ACTUALIZAR ESTADOS
return;
}
try {
const res = await fetch(`${API_URL}/operators?guild_id=${guildId}`, { headers: { "Authorization": `Bearer ${localStorage.getItem("token")}` } });
const data = await res.json();
sel.innerHTML = '<option value="">-- Automática --</option>';
data.operators.forEach(op => sel.innerHTML += `<option value="${op.id}">${op.full_name}</option>`);
filterStatusOptions(); // <--- ACTUALIZAR ESTADOS
} catch(e) {}
}