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:
Davidson Gomes
2024-06-26 19:27:06 -03:00
parent b70ab5a4c3
commit d342a7b621
4 changed files with 8 additions and 90 deletions

View File

@@ -1831,8 +1831,6 @@ export class BaileysStartupService extends ChannelStartupService {
throw new NotFoundException('Group not found');
}
console.log('options', options);
if (options.mentionsEveryOne) {
mentions = group.participants.map((participant) => participant.id);
} else if (options.mentioned?.length) {