fix: Solved problem with duplicate messages in chatwoot

This commit is contained in:
Davidson Gomes
2023-10-09 18:00:14 -03:00
parent 29fd448998
commit 62c74deac3
9 changed files with 151 additions and 17 deletions

View File

@@ -1,15 +1,21 @@
import { Request, Response } from 'express';
import { ConfigService } from '../../config/env.config';
import { Auth, ConfigService, HttpServer } from '../../config/env.config';
import { HttpStatus } from '../routers/index.router';
import { WAMonitoringService } from '../services/monitor.service';
export class ViewsController {
constructor(private readonly waMonit: WAMonitoringService, private readonly configService: ConfigService) {}
constructor(private readonly waMonitor: WAMonitoringService, private readonly configService: ConfigService) {}
public async manager(request: Request, response: Response) {
try {
return response.status(HttpStatus.OK).render('manager');
const token = this.configService.get<Auth>('AUTHENTICATION').API_KEY.KEY;
const port = this.configService.get<HttpServer>('SERVER').PORT;
const instances = await this.waMonitor.instanceInfo();
console.log('INSTANCES: ', instances);
return response.status(HttpStatus.OK).render('manager', { token, port, instances });
} catch (error) {
console.log('ERROR: ', error);
}