Actualizar server.js

This commit is contained in:
2026-02-20 21:07:55 +00:00
parent b2a31e9333
commit d1ec6a89f5

View File

@@ -635,9 +635,11 @@ async function triggerWhatsAppEvent(ownerId, serviceId, eventType) {
const tplTypeMap = { const tplTypeMap = {
'wa_evt_welcome': 'welcome', 'wa_evt_welcome': 'welcome',
'wa_evt_date': 'appointment', 'wa_evt_date': 'appointment',
'wa_evt_update': 'update', // <--- AÑADIDO: Modificación de cita
'wa_evt_onway': 'on_way', 'wa_evt_onway': 'on_way',
'wa_evt_survey': 'survey' 'wa_evt_survey': 'survey'
}; };
const tplQ = await pool.query("SELECT content FROM message_templates WHERE owner_id=$1 AND type=$2", [ownerId, tplTypeMap[eventType]]); const tplQ = await pool.query("SELECT content FROM message_templates WHERE owner_id=$1 AND type=$2", [ownerId, tplTypeMap[eventType]]);
if (tplQ.rowCount === 0 || !tplQ.rows[0].content) return; if (tplQ.rowCount === 0 || !tplQ.rows[0].content) return;
let text = tplQ.rows[0].content; let text = tplQ.rows[0].content;