({ socketId, comment }: { socketId?: string; comment: ICommentDocument })
| 215 | } |
| 216 | |
| 217 | function commentAdded({ socketId, comment }: { socketId?: string; comment: ICommentDocument }) { |
| 218 | const roomName = `discussion-${comment.discussionId}`; |
| 219 | |
| 220 | const socket = getSocket(socketId); |
| 221 | if (socket) { |
| 222 | socket.to(roomName).emit('commentEvent', { actionType: 'added', comment }); |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | function commentEdited({ socketId, comment }: { socketId?: string; comment: ICommentDocument }) { |
| 227 | const roomName = `discussion-${comment.discussionId}`; |
no test coverage detected