mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-22 05:12:20 -06:00
feat: Adds method to fetch contacts with last message
- Implements the `fetchContactsWithLastMessage` method in `ChatController` to retrieve contacts and their last messages. - Updates `ChatRouter` to include the new route that calls the above method. - Adds logic in `ChannelStartupService` to fetch contacts and their last messages, improving contact management functionality.
This commit is contained in:
@@ -8,13 +8,17 @@ const logger = new Logger('Socket');
|
||||
|
||||
let io: SocketIO;
|
||||
|
||||
const cors = configService.get<Cors>('CORS').ORIGIN;
|
||||
const origin = configService.get<Cors>('CORS').ORIGIN;
|
||||
const methods = configService.get<Cors>('CORS').METHODS;
|
||||
const credentials = configService.get<Cors>('CORS').CREDENTIALS;
|
||||
|
||||
export const initIO = (httpServer: Server) => {
|
||||
if (configService.get<Websocket>('WEBSOCKET')?.ENABLED) {
|
||||
io = new SocketIO(httpServer, {
|
||||
cors: {
|
||||
origin: cors,
|
||||
origin,
|
||||
methods,
|
||||
credentials,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user