diff --git a/modules/turnero/views/chat.php b/modules/turnero/views/chat.php index bc75bbb..219a5d5 100644 --- a/modules/turnero/views/chat.php +++ b/modules/turnero/views/chat.php @@ -1002,7 +1002,10 @@ async function sendTemplate() { const missing = params.findIndex(p => !p); if (missing !== -1) { inputs[missing].focus(); return; } + const templateName = _tplSelected.template_name; + const templateLang = _tplSelected.language_code; closeTemplatePicker(); + try { const res = await fetch(BASE + API_SEND, { method: 'POST', @@ -1010,8 +1013,8 @@ async function sendTemplate() { body: JSON.stringify({ user_id: state.activeUserId, type: 'template', - template: _tplSelected.template_name, - lang: _tplSelected.language_code, + template: templateName, + lang: templateLang, params }) });