diff --git a/calendario.html b/calendario.html index d11f1e0..93e5103 100644 --- a/calendario.html +++ b/calendario.html @@ -180,6 +180,9 @@ + @@ -1507,6 +1510,22 @@ } else { alert("Sin teléfono"); } } + async function sendInstagramPromo() { + const id = document.getElementById('detId').value; + if (!id) return; + try { + const res = await fetch(`${API_URL}/services/${id}/send-instagram`, { + method: 'POST', + headers: { "Authorization": `Bearer ${localStorage.getItem("token")}` } + }); + const data = await res.json(); + if (data.ok) alert("¡Mensaje de Instagram enviado! 📸"); + else alert(data.error || "No se pudo enviar el mensaje de Instagram."); + } catch (e) { + alert("Error de conexión al enviar el mensaje de Instagram."); + } + } + // 🧑‍🔧 Abre la ficha del cliente (historial de servicios + notas del equipo) con los // datos que ya tenemos cargados en el modal, para no tener que volver a pedirlos. function abrirFichaCliente() {