fix: Remove unnecessary attributes from notification deleted action cable event payload (#9295)
fix: simplify notification deleted payload event
This commit is contained in:
parent
9086650fe2
commit
1bf3ad9a08
@ -18,7 +18,7 @@ class ActionCableListener < BaseListener
|
|||||||
|
|
||||||
notification, account, unread_count, count = extract_notification_and_account(event)
|
notification, account, unread_count, count = extract_notification_and_account(event)
|
||||||
tokens = [event.data[:notification].user.pubsub_token]
|
tokens = [event.data[:notification].user.pubsub_token]
|
||||||
broadcast(account, tokens, NOTIFICATION_DELETED, { notification: notification.push_event_data, unread_count: unread_count, count: count })
|
broadcast(account, tokens, NOTIFICATION_DELETED, { notification: { id: notification.id }, unread_count: unread_count, count: count })
|
||||||
end
|
end
|
||||||
|
|
||||||
def account_cache_invalidated(event)
|
def account_cache_invalidated(event)
|
||||||
|
|||||||
@ -142,7 +142,9 @@ describe ActionCableListener do
|
|||||||
'notification.deleted',
|
'notification.deleted',
|
||||||
{
|
{
|
||||||
account_id: notification.account_id,
|
account_id: notification.account_id,
|
||||||
notification: notification.push_event_data,
|
notification: {
|
||||||
|
id: notification.id
|
||||||
|
},
|
||||||
unread_count: 1,
|
unread_count: 1,
|
||||||
count: 1
|
count: 1
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user