1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-20 00:25:17 +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

@ -156,6 +156,11 @@ export class CommentsHelper {
await DatabaseHelper.DeleteRows(COMMENTS_TABLE, {
ID: comment.id
})
// Notify system
await EventsHelper.Emit("comment_deleted", {
comment: comment
});
}
/**

View File

@ -39,6 +39,11 @@ export interface CommentUpdatedEvent {
commentID: number
}
// When a comment is deleted
export interface CommentDeletedEvent {
comment: Comment
}
/**
* Global map of all possible events
*/
@ -48,7 +53,8 @@ export interface EventsMap {
"updated_number_unread_conversations": UpdateNumberUnreadConversationsEvent,
"sent_conversation_message": SentNewConversationMessageEvent,
"comment_created": CommentCreatedEvent,
"comment_updated": CommentUpdatedEvent
"comment_updated": CommentUpdatedEvent,
"comment_deleted": CommentDeletedEvent,
}
export class EventsHelper {