Skip to content

Commit

Permalink
fix(채팅): 소켓 채팅 반환형식 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
jsween5723 committed Jan 12, 2024
1 parent 5fc226e commit 48a074a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/room/room.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { FlattenMaps, Types } from 'mongoose';
import { DetailGateway } from './detail/detail.gateway';
import { User } from '../user/schema/user.schema';
import { Meeting } from './entity/room.schema';
import { ChatDto } from './dto/chat.dto';

@Injectable()
export class RoomService {
Expand Down Expand Up @@ -120,7 +121,7 @@ export class RoomService {
this.detailGateway.io.server
.of(`/chat-rooms/${chat.roomId}`)
.to(chat.roomId)
.emit('chat-append', createdChat);
.emit('chat-append', new ChatDto(createdChat));
const sockets = await this.detailGateway.io.server
.of(`/chat-rooms/${chat.roomId}`)
.in(chat.roomId)
Expand All @@ -133,7 +134,7 @@ export class RoomService {
this.roomGateway.io.server
.of('/chat-rooms')
.to(users.map((user) => user.id))
.emit('last-chat-append', createdChat);
.emit('last-chat-append', new ChatDto(createdChat));
return createdChat;
}

Expand Down

0 comments on commit 48a074a

Please sign in to comment.