chore: Add controllers for conversation participants (#6462)

Co-authored-by: Aswin Dev P.S <aswindevps@gmail.com>
Co-authored-by: Sojan Jose <sojan@chatwoot.com>
This commit is contained in:
Pranav Raj S
2023-02-15 16:33:31 -08:00
committed by GitHub
parent 949ddf68ba
commit 7044eda281
34 changed files with 546 additions and 63 deletions

View File

@@ -0,0 +1,3 @@
json.array! @participants do |participant|
json.partial! 'api/v1/models/agent', format: :json, resource: participant.user
end

View File

@@ -0,0 +1,3 @@
json.array! @participants do |participant|
json.partial! 'api/v1/models/agent', format: :json, resource: participant.user
end

View File

@@ -11,7 +11,11 @@ json.data do
json.notification_type notification.notification_type
json.push_message_title notification.push_message_title
# TODO: front end assumes primary actor to be conversation. should fix in future
if %w[assigned_conversation_new_message conversation_mention].include? notification.notification_type
if %w[
assigned_conversation_new_message
participating_conversation_new_message
conversation_mention
].include? notification.notification_type
json.primary_actor_type 'Conversation'
json.primary_actor_id notification.conversation.id
json.primary_actor notification.conversation.push_event_data

View File

@@ -0,0 +1,5 @@
<p>Hi {{user.available_name}},</p>
<p>You have received a new message in a conversation you are participating.</p>
<p>Click <a href="{{action_url}}">here</a> to get cracking.</p>