mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-20 04:12:23 -06:00
chore: Refactor WAMonitoringService instance retrieval and improve code readability
Refactored WAMonitoringService to retrieve instances using Prisma's `findMany` method with a dynamic `where` clause. This change simplifies the code and makes it more maintainable. It also removes the deprecated `for...of` loop and the unnecessary instantiation of objects. The new implementation provides better performance and is more aligned with the current best practices. Modified files: - src/api/services/monitor.service.ts
This commit is contained in:
@@ -89,7 +89,7 @@ export class InstanceController {
|
||||
chatwootLogo,
|
||||
}: InstanceDto) {
|
||||
try {
|
||||
await this.authService.checkDuplicateToken(token);
|
||||
if (token) await this.authService.checkDuplicateToken(token);
|
||||
|
||||
if (!token && integration === Integration.WHATSAPP_BUSINESS) {
|
||||
throw new BadRequestException('token is required');
|
||||
|
||||
Reference in New Issue
Block a user