fix: Comment deletion is not propagated correctly

This commit is contained in:
Tom Moor
2023-03-11 19:01:19 -05:00
parent 2c84036a3a
commit e9ece9125a
3 changed files with 18 additions and 14 deletions

View File

@@ -372,15 +372,8 @@ export default class WebsocketsProcessor {
}
case "comments.delete": {
const comment = await Comment.scope([
"defaultScope",
"withDocument",
]).findByPk(event.modelId);
if (!comment) {
return;
}
return socketio
.to(`collection-${comment.document.collectionId}`)
.to(`collection-${event.collectionId}`)
.emit(event.name, {
modelId: event.modelId,
});