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

@ -95,12 +95,26 @@ export class WAMonitoringService {
});
}
} else {
instances.push({
instance: {
instanceName: key,
status: value.connectionStatus.state,
},
});
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: {
instanceName: key,
status: value.connectionStatus.state,
},
});
}
}
}
}