fix: collections.create event not propagated when initialized with private permissions

This commit is contained in:
Tom Moor
2022-08-24 22:49:44 +02:00
parent de5524d366
commit 983010b5d8
2 changed files with 10 additions and 11 deletions

View File

@@ -13,6 +13,7 @@ import {
Team,
} from "@server/models";
import {
presentCollection,
presentDocument,
presentFileOperation,
presentPin,
@@ -177,22 +178,15 @@ export default class WebsocketsProcessor {
.to(
collection.permission
? `team-${collection.teamId}`
: `collection-${collection.id}`
: `user-${collection.createdById}`
)
.emit("entities", {
event: event.name,
collectionIds: [
{
id: collection.id,
updatedAt: collection.updatedAt,
},
],
});
.emit(event.name, presentCollection(collection));
return socketio
.to(
collection.permission
? `team-${collection.teamId}`
: `collection-${collection.id}`
: `user-${collection.createdById}`
)
.emit("join", {
event: event.name,