Actualizar proveedores.html
This commit is contained in:
@@ -372,12 +372,17 @@
|
|||||||
|
|
||||||
async function loadOpsForGuild(guildId) {
|
async function loadOpsForGuild(guildId) {
|
||||||
const sel = document.getElementById('impOperator');
|
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 {
|
try {
|
||||||
const res = await fetch(`${API_URL}/operators?guild_id=${guildId}`, { headers: { "Authorization": `Bearer ${localStorage.getItem("token")}` } });
|
const res = await fetch(`${API_URL}/operators?guild_id=${guildId}`, { headers: { "Authorization": `Bearer ${localStorage.getItem("token")}` } });
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
sel.innerHTML = '<option value="">-- Automática --</option>';
|
sel.innerHTML = '<option value="">-- Automática --</option>';
|
||||||
data.operators.forEach(op => sel.innerHTML += `<option value="${op.id}">${op.full_name}</option>`);
|
data.operators.forEach(op => sel.innerHTML += `<option value="${op.id}">${op.full_name}</option>`);
|
||||||
|
filterStatusOptions(); // <--- ACTUALIZAR ESTADOS
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user