From c8e0427475582e207757b813e63dac65c480cc74 Mon Sep 17 00:00:00 2001 From: marsalva Date: Tue, 13 Oct 2026 08:23:14 +0000 Subject: [PATCH] Actualizar calendario.html --- calendario.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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() {