chore: equations and adjustments for the new manager

This commit is contained in:
Davidson Gomes
2024-07-23 12:34:58 -03:00
parent 837f7f310a
commit c1d3209f2f
16 changed files with 181 additions and 33 deletions

View File

@@ -67,8 +67,8 @@ export class ChatController {
return await this.waMonitor.waInstances[instanceName].fetchStatusMessage(query);
}
public async fetchChats({ instanceName }: InstanceDto) {
return await this.waMonitor.waInstances[instanceName].fetchChats();
public async fetchChats({ instanceName }: InstanceDto, query: Query<Contact>) {
return await this.waMonitor.waInstances[instanceName].fetchChats(query);
}
public async sendPresence({ instanceName }: InstanceDto, data: SendPresenceDto) {

View File

@@ -594,7 +594,8 @@ export class InstanceController {
switch (state) {
case 'open':
if (this.configService.get<Chatwoot>('CHATWOOT').ENABLED) instance.clearCacheChatwoot();
await instance.reloadConnection();
// await instance.reloadConnection();
await instance.client?.ws?.close();
await delay(2000);
return await this.connectionState({ instanceName });