mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-22 03:56:54 -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();
|
||||
|
||||
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;
|
||||
|
@ -136,11 +136,13 @@ export class WAStartupService {
|
||||
|
||||
public async findIntegration() {
|
||||
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) {
|
||||
this.logger.verbose('Integration not found');
|
||||
throw new NotFoundException('Integration not found');
|
||||
this.repository.integration.create({ integration: 'WHATSAPP-BAILEYS', number: '', token: '' }, this.instanceName);
|
||||
data = { integration: 'WHATSAPP-BAILEYS', number: '', token: '' };
|
||||
}
|
||||
|
||||
this.logger.verbose(`Integration: ${data.integration}`);
|
||||
|
Loading…
Reference in New Issue
Block a user