fix: fetchInstances with clientName parameter

This commit is contained in:
Davidson Gomes
2024-08-02 19:22:44 -03:00
parent 3fa6b1fcc5
commit 671b677569
2 changed files with 5 additions and 1 deletions

View File

@@ -68,7 +68,9 @@ export class WAMonitoringService {
throw new NotFoundException(`Instance "${instanceName}" not found`);
}
const where = instanceName ? { name: instanceName } : {};
const clientName = await this.configService.get<Database>('DATABASE').CONNECTION.CLIENT_NAME;
const where = instanceName ? { name: instanceName, clientName } : { clientName };
const instances = await this.prismaRepository.instance.findMany({
where,