feat: Add labels, status and priority in notification push_event_data (#8972)

This commit is contained in:
Muhsin Keloth
2024-02-20 17:17:25 +05:30
committed by GitHub
parent 5d9fb55370
commit c5c0845151
2 changed files with 2 additions and 9 deletions

View File

@@ -68,20 +68,12 @@ class Notification < ApplicationRecord
}
if primary_actor.present?
payload[:primary_actor] = primary_actor_data
payload[:primary_actor] = primary_actor&.push_event_data
payload[:push_message_title] = push_message_title
end
payload
end
def primary_actor_data
{
id: primary_actor.push_event_data[:id],
meta: primary_actor.push_event_data[:meta],
inbox_id: primary_actor.push_event_data[:inbox_id]
}
end
def fcm_push_data
{
id: id,

View File

@@ -29,6 +29,7 @@ RSpec.describe 'Notifications API', type: :request do
expect(response_json['data']['meta']['count']).to eq 2
# notification appear in descending order
expect(response_json['data']['payload'].first['id']).to eq notification2.id
expect(response_json['data']['payload'].first['primary_actor']).not_to be_nil
end
end
end