1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-24 22:39:21 +00:00

Update method

This commit is contained in:
Pierre HUBERT 2020-04-02 19:03:31 +02:00
parent 5d9067d3a7
commit cda807ae65

View File

@ -165,13 +165,11 @@ export class UserWebSocketActions {
public static async UpdatedComment(commentID: number) {
const comment = await CommentsHelper.GetSingle(commentID);
for(const client of UserWebSocketController.active_clients.filter((e) => e.registeredPosts.has(comment.postID))) {
UserWebSocketController.SendToClient(client, new WsMessage({
id: "",
title: "comment_updated",
data: await CommentsController.CommentToAPI(new AbritraryUserConnection(client.userID), comment)
}))
}
await UserWebSocketController.SendToSpecifcClients(
(e) => e.registeredPosts.has(comment.postID),
async (client) => WsMessage.NoIDMessage("comment_updated",
await CommentsController.CommentToAPI(new AbritraryUserConnection(client.userID), comment))
)
}
/**