fix(all): Locale in Audio is dynamic.

This commit is contained in:
Rodrigo Rodriguez 2024-02-17 22:21:40 -03:00
parent d1c4c23fa1
commit fb6e57b19a
3 changed files with 25 additions and 24 deletions

File diff suppressed because one or more lines are too long

View file

@ -1097,7 +1097,7 @@ export class GBConversationalService {
// Detects user typed language and updates their locale profile if applies. // Detects user typed language and updates their locale profile if applies.
let locale = min.core.getParam( let locale = user.locale ? user.locale : min.core.getParam(
min.instance, min.instance,
'Default User Language', 'Default User Language',
GBConfigService.get('DEFAULT_USER_LANGUAGE')); GBConfigService.get('DEFAULT_USER_LANGUAGE'));

View file

@ -958,10 +958,7 @@ export class WhatsappDirectLine extends GBService {
private async WhatsAppCallback(req, res) { private async WhatsAppCallback(req, res) {
try { try {
if (req.body && req.body.webhook) { if (!req.body) {
res.status(200);
res.end();
return; return;
} }
@ -1068,8 +1065,10 @@ export class WhatsappDirectLine extends GBService {
user = await sec.ensureUser(urlMin, id, '', '', 'omnichannel', '', ''); user = await sec.ensureUser(urlMin, id, '', '', 'omnichannel', '', '');
user = await sec.updateUserInstance(id, urlMin.instance.instanceId); user = await sec.updateUserInstance(id, urlMin.instance.instanceId);
if (locale){
user = await sec.updateUserLocale(user.userId, locale); user = await sec.updateUserLocale(user.userId, locale);
} }
}
let activeMin; let activeMin;