diff --git a/src/common/base/repository.ts b/src/common/base/repository.ts index 5bbc935..be509ff 100644 --- a/src/common/base/repository.ts +++ b/src/common/base/repository.ts @@ -12,7 +12,7 @@ abstract class BaseRepository { } async findAll() { - return this.model.find().populate({ path: "fineRule" }).sort({ createdAt: -1 }); + return this.model.find().sort({ createdAt: -1 }); } async delete(id: string) { diff --git a/src/modules/chat/chat.gateway.ts b/src/modules/chat/chat.gateway.ts index fa8c5b5..6a3a3eb 100644 --- a/src/modules/chat/chat.gateway.ts +++ b/src/modules/chat/chat.gateway.ts @@ -19,13 +19,12 @@ export class ChatGateway { this.io = new Server(server, { path: "/ws-chat", // addTrailingSlash: false, - // cors: { - // origin: true, - // allowedHeaders: ["Authorization"], - // credentials: true, - // methods: ["GET", "POST"], - // }, - cors: { origin: "*" }, + cors: { + origin: true, + allowedHeaders: ["Authorization"], + credentials: true, + methods: ["GET", "POST"], + }, }); this.io.on("connection", (socket: Socket) => this.handleConnection(socket)); return this.io;