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:
Davidson Gomes
2025-05-12 12:48:05 -03:00
parent 86c603b3a1
commit cee6498ea0
4 changed files with 55 additions and 2 deletions

View File

@@ -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,
},
});