1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-24 02:13:28 +00:00

Create an event for deleted comments

This commit is contained in:
2020-04-02 18:25:23 +02:00
parent 1502906c09
commit 768b5360a3
3 changed files with 25 additions and 4 deletions

View File

@ -158,7 +158,7 @@ export class UserWebSocketActions {
/**
* Propagate comment update
*
* @param c New comment
* @param c Updated comment
*/
public static async UpdatedComment(commentID: number) {
const comment = await CommentsHelper.GetSingle(commentID);
@ -171,6 +171,15 @@ export class UserWebSocketActions {
}))
}
}
/**
* Propagage the deletion of a comment
*
* @param comment Deleted comment
*/
public static async DeletedComment(comment: Comment) {
console.log(comment);
}
}
@ -183,6 +192,7 @@ EventsHelper.Listen("updated_number_unread_conversations", async (e) => await Us
// When a new message is sent
EventsHelper.Listen("sent_conversation_message", async (e) => await UserWebSocketActions.SentNewConversationMessage(e.msg));
// When a comment is created / updated
// When a comment is created / updated / deleted
EventsHelper.Listen("comment_created", async (e) => await UserWebSocketActions.CreatedNewComment(e.comment))
EventsHelper.Listen("comment_updated", async (e) => await UserWebSocketActions.UpdatedComment(e.commentID));
EventsHelper.Listen("comment_updated", async (e) => await UserWebSocketActions.UpdatedComment(e.commentID));
EventsHelper.Listen("comment_deleted", async (e) => await UserWebSocketActions.DeletedComment(e.comment));