fix: include instance Id field in the instance configuration

This commit is contained in:
Davidson Gomes
2023-12-17 09:37:18 -03:00
parent 2d6a29664a
commit da796347c4
2 changed files with 6 additions and 3 deletions

View File

@@ -162,6 +162,10 @@ export class WAMonitoringService {
public async instanceInfoById(instanceId?: string) {
this.logger.verbose('get instance info');
const instanceName = await this.repository.auth.findInstanceNameById(instanceId);
if (!instanceName) {
throw new NotFoundException(`Instance "${instanceId}" not found`);
}
if (instanceName && !this.waInstances[instanceName]) {
throw new NotFoundException(`Instance "${instanceName}" not found`);
}