feat: added option to generate qrcode as soon as the instance is created

This commit is contained in:
Davidson Gomes 2023-06-13 17:42:30 -03:00
parent fdc72bc84e
commit 631dd01c92

View File

@ -94,6 +94,19 @@ export class WAMonitoringService {
},
});
}
} else {
let apikey: string;
if (this.configService.get<Auth>('AUTHENTICATION').EXPOSE_IN_FETCH_INSTANCES) {
const tokenStore = await this.repository.auth.find(key);
apikey = tokenStore.apikey || 'Apikey not found';
instances.push({
instance: {
instanceName: key,
status: value.connectionStatus.state,
apikey,
},
});
} else {
instances.push({
instance: {
@ -104,6 +117,7 @@ export class WAMonitoringService {
}
}
}
}
return instances.find((i) => i.instance.instanceName === instanceName) ?? instances;
}