up
This commit is contained in:
+10
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user