fix: Solved problem when disconnecting from the instance the instance was deleted

This commit is contained in:
Davidson Gomes
2023-07-29 11:09:56 -03:00
parent f89c2b1f63
commit fe2b9774d8
7 changed files with 29 additions and 96 deletions

View File

@@ -187,7 +187,7 @@ export class InstanceController {
this.chatwootService.initInstanceChatwoot(
instance,
instance.instanceName,
instance.instanceName.split('-cwId-')[0],
`${urlServer}/chatwoot/webhook/${instance.instanceName}`,
qrcode,
number,
@@ -234,6 +234,10 @@ export class InstanceController {
this.logger.verbose('state: ' + state);
if (!state) {
throw new BadRequestException('The "' + instanceName + '" instance does not exist');
}
if (state == 'open') {
return await this.connectionState({ instanceName });
}