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:
@ -156,6 +156,11 @@ export class CommentsHelper {
|
||||
await DatabaseHelper.DeleteRows(COMMENTS_TABLE, {
|
||||
ID: comment.id
|
||||
})
|
||||
|
||||
// Notify system
|
||||
await EventsHelper.Emit("comment_deleted", {
|
||||
comment: comment
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user