Skip to content

Commit

Permalink
fix(all): Minor changes in PROD.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Jul 28, 2023
1 parent 44bc37c commit e415bb0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions packages/core.gbapp/services/GBDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packages/core.gbapp/services/GBImporterService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/core.gbapp/services/GBMinService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/core.gbapp/services/GBSSR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 === '/'
Expand Down

0 comments on commit e415bb0

Please sign in to comment.