fix(all): Minor changes in PROD.

This commit is contained in:
Rodrigo Rodriguez 2023-07-28 20:22:45 -03:00
parent 44bc37c2e6
commit e415bb01ca
4 changed files with 3 additions and 7 deletions

View file

@ -205,7 +205,6 @@ export class GBDeployer implements IGBDeployer {
public async deployBlankBot(botId: string, mobile: string, email: string) {
// Creates a new row on the GuaribasInstance table.
const instance = await this.importer.createBotInstance(botId);
const bootInstance = GBServer.globals.bootInstance;
@ -230,9 +229,6 @@ export class GBDeployer implements IGBDeployer {
instance.state = 'active';
instance.nlpScore = 0.8;
instance.searchScore = 0.25;
instance.whatsappServiceKey = null;
instance.whatsappServiceNumber = null;
instance.whatsappServiceUrl = null;
instance.params = JSON.stringify({ 'Can Publish': mobile, 'Admin Notify E-mail': email });
// Saves bot information to the store.

View file

@ -99,7 +99,7 @@ export class GBImporter {
}
public async createBotInstance (botId: string) {
const fullSettingsJson = <GuaribasInstance>{ ...GBServer.globals.bootInstance };
const fullSettingsJson = <GuaribasInstance>{ };
fullSettingsJson['botId'] = botId;
return await GuaribasInstance.create(fullSettingsJson);

View file

@ -771,7 +771,7 @@ export class GBMinService {
await min.whatsAppDirectLine.setup(true);
} else {
const minBoot = GBServer.globals.minBoot as any;
if (min !== minBoot) {
if (min !== minBoot && minBoot.instance.whatsappServiceKey) {
min.whatsAppDirectLine = new WhatsappDirectLine(
min,
min.botId,

View file

@ -286,7 +286,7 @@ export class GBSSR {
const onlyChars = /\/([A-Za-z0-9\-\_]+)\/*/.exec(req.originalUrl);
let botId = (req.originalUrl && req.originalUrl === '/') || onlyChars.length === 0 ? minBoot.botId : onlyChars[1];
let botId = (req.originalUrl && req.originalUrl === '/') || onlyChars ? onlyChars[1] : minBoot.botId;
let min: GBMinInstance =
req.url === '/'