2021-10-24 07:10:30 +00:00
|
|
|
class Api::V1::Accounts::Contacts::ContactInboxesController < Api::V1::Accounts::Contacts::BaseController
|
2020-08-10 06:45:29 +00:00
|
|
|
before_action :ensure_inbox, only: [:create]
|
|
|
|
|
|
|
|
def create
|
2022-10-13 22:12:04 +00:00
|
|
|
@contact_inbox = ContactInboxBuilder.new(
|
|
|
|
contact: @contact,
|
|
|
|
inbox: @inbox,
|
|
|
|
source_id: params[:source_id]
|
|
|
|
).perform
|
2020-08-10 06:45:29 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def ensure_inbox
|
|
|
|
@inbox = Current.account.inboxes.find(params[:inbox_id])
|
2021-06-11 06:14:31 +00:00
|
|
|
authorize @inbox, :show?
|
2020-08-10 06:45:29 +00:00
|
|
|
end
|
|
|
|
end
|