mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-29 10:12:34 +00:00
25 lines
600 B
Ruby
25 lines
600 B
Ruby
class Public::Api::V1::Inboxes::ConversationsController < Public::Api::V1::InboxesController
|
|
def index
|
|
@conversations = @contact_inbox.hmac_verified? ? @contact.conversations : @contact_inbox.conversations
|
|
end
|
|
|
|
def create
|
|
@conversation = create_conversation
|
|
end
|
|
|
|
private
|
|
|
|
def create_conversation
|
|
::Conversation.create!(conversation_params)
|
|
end
|
|
|
|
def conversation_params
|
|
{
|
|
account_id: @contact_inbox.contact.account_id,
|
|
inbox_id: @contact_inbox.inbox_id,
|
|
contact_id: @contact_inbox.contact_id,
|
|
contact_inbox_id: @contact_inbox.id
|
|
}
|
|
end
|
|
end
|