This commit is contained in:
Lizandro Guarnizo
2026-01-21 22:31:46 -05:00
parent ab993302f9
commit 32f5f580f7
4 changed files with 119 additions and 8 deletions
+10 -1
View File
@@ -869,7 +869,10 @@ class SimpleWhatsAppManager {
const response = await this.apiCall('get_templates.php');
if (response && response.success) {
this.updateTemplatesList(response.data || []);
const tmpl = response.data || [];
this.templatesData = tmpl;
this.templates = tmpl; // compatibilidad con app.js
this.updateTemplatesList(tmpl);
} else {
this.showError('Error cargando plantillas');
}
@@ -1553,6 +1556,12 @@ class SimpleWhatsAppManager {
}
async deleteTemplateAction(templateId) {
// intentar obtener el nombre de la plantilla para confirmar
const tmpl = (this.templatesData || []).find(t => t.id === templateId) || {};
const name = tmpl.name || tmpl.template_name || `ID ${templateId}`;
if (!confirm(`¿Estás seguro de que quiere eliminar la plantilla "${name}"? Esta acción no se puede deshacer.`)) return;
this.log(`Eliminando plantilla ID: ${templateId}`);
try {