feat: Builder for creating Campaign conversations (#2192)

- Builder for creating Campaign conversations
- Widget endpoint to fetch the campaigns
This commit is contained in:
Sojan Jose
2021-05-03 20:23:09 +05:30
committed by GitHub
parent b649516fbb
commit 98e2a9b8b5
13 changed files with 182 additions and 6 deletions

View File

@@ -2,7 +2,8 @@ class Api::V1::Widget::EventsController < Api::V1::Widget::BaseController
include Events::Types
def create
Rails.configuration.dispatcher.dispatch(permitted_params[:name], Time.zone.now, contact_inbox: @contact_inbox, event_info: event_info)
Rails.configuration.dispatcher.dispatch(permitted_params[:name], Time.zone.now, contact_inbox: @contact_inbox,
event_info: permitted_params[:event_info].to_h.merge(event_info))
head :no_content
end
@@ -17,6 +18,6 @@ class Api::V1::Widget::EventsController < Api::V1::Widget::BaseController
end
def permitted_params
params.permit(:name, :website_token)
params.permit(:name, :website_token, event_info: {})
end
end