mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
- Add dynamic importing for routes. - Added caching for `campaign`, `articles` and `inbox_members` API end points. --------- Co-authored-by: Pranav <pranavrajs@gmail.com>
21 lines
505 B
Ruby
21 lines
505 B
Ruby
class Api::V1::Accounts::Contacts::ContactInboxesController < Api::V1::Accounts::Contacts::BaseController
|
|
include HmacConcern
|
|
before_action :ensure_inbox, only: [:create]
|
|
|
|
def create
|
|
@contact_inbox = ContactInboxBuilder.new(
|
|
contact: @contact,
|
|
inbox: @inbox,
|
|
source_id: params[:source_id],
|
|
hmac_verified: hmac_verified?
|
|
).perform
|
|
end
|
|
|
|
private
|
|
|
|
def ensure_inbox
|
|
@inbox = Current.account.inboxes.find(params[:inbox_id])
|
|
authorize @inbox, :show?
|
|
end
|
|
end
|