WIP
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
* @property User $user
|
||||
* @property ModelCustomerCustomerGroup $model_customer_customer_group
|
||||
* @property ModelLocalisationOrderStatus $model_localisation_order_status
|
||||
* @property DB $db
|
||||
*/
|
||||
class ControllerExtensionModuleTgshop extends Controller
|
||||
{
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
/>
|
||||
<script>
|
||||
$('#{{ settingKey }}-btn').click(function () {
|
||||
const telegramToken = $('#module_tgshop_bot_token').val(); // fetch from input
|
||||
const telegramToken = $('#module_tgshop_bot_token').val().trim(); // fetch from input
|
||||
if (! telegramToken) {
|
||||
alert('Сначала введите Telegram Bot Token!');
|
||||
return;
|
||||
@@ -251,19 +251,19 @@
|
||||
</div>
|
||||
<script>
|
||||
$('#{{ settingKey }}-btn-test').click(function () {
|
||||
const telegramToken = $('#module_tgshop_bot_token').val(); // fetch from input
|
||||
const telegramToken = $('#module_tgshop_bot_token').val().trim();
|
||||
if (! telegramToken) {
|
||||
alert('Сначала введите Telegram Bot Token!');
|
||||
return;
|
||||
}
|
||||
|
||||
const chatId = $('#module_tgshop_chat_id').val(); // fetch from input
|
||||
const chatId = $('#module_tgshop_chat_id').val().trim();
|
||||
if (! chatId) {
|
||||
alert('Сначала введите Chat ID!');
|
||||
return;
|
||||
}
|
||||
|
||||
const template = $('#{{ settingKey }}').val();
|
||||
const template = $('#{{ settingKey }}').val().trim();
|
||||
if (! template) {
|
||||
alert('Сначала задайте шаблон!');
|
||||
return;
|
||||
@@ -272,7 +272,7 @@
|
||||
fetch('/index.php?route=extension/tgshop/handle&api_action=testTgMessage', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
token: telegramToken,
|
||||
|
||||
Reference in New Issue
Block a user