mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-23 04:22:02 -06:00
adjusts in integration
This commit is contained in:
parent
53361682f4
commit
e27818ecda
@ -22,7 +22,8 @@ export class IntegrationService {
|
|||||||
const result = await this.waMonitor.waInstances[instance.instanceName].findIntegration();
|
const result = await this.waMonitor.waInstances[instance.instanceName].findIntegration();
|
||||||
|
|
||||||
if (Object.keys(result).length === 0) {
|
if (Object.keys(result).length === 0) {
|
||||||
throw new Error('Integration not found');
|
this.create(instance, { integration: 'WHATSAPP-BAILEYS', number: '', token: '' });
|
||||||
|
return { integration: 'WHATSAPP-BAILEYS', number: '', token: '' };
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -136,11 +136,13 @@ export class WAStartupService {
|
|||||||
|
|
||||||
public async findIntegration() {
|
public async findIntegration() {
|
||||||
this.logger.verbose('Finding integration');
|
this.logger.verbose('Finding integration');
|
||||||
const data = await this.repository.integration.find(this.instanceName);
|
let data: any;
|
||||||
|
|
||||||
|
data = await this.repository.integration.find(this.instanceName);
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
this.logger.verbose('Integration not found');
|
this.repository.integration.create({ integration: 'WHATSAPP-BAILEYS', number: '', token: '' }, this.instanceName);
|
||||||
throw new NotFoundException('Integration not found');
|
data = { integration: 'WHATSAPP-BAILEYS', number: '', token: '' };
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.verbose(`Integration: ${data.integration}`);
|
this.logger.verbose(`Integration: ${data.integration}`);
|
||||||
|
Loading…
Reference in New Issue
Block a user