[Enhancement] Add CopyToClipboard action in code component (#329)

* Add CopyToClipboard action in websiteWidgetCode component

* Fix codeclimate issues
This commit is contained in:
Pranav Raj S
2019-11-30 17:33:42 +05:30
committed by Sojan Jose
parent a3662091c7
commit 60e96f446e
18 changed files with 283 additions and 90 deletions

View File

@@ -1,17 +1,22 @@
class Api::V1::Widget::InboxesController < ApplicationController
class Api::V1::Widget::InboxesController < Api::BaseController
before_action :authorize_request
def create
ActiveRecord::Base.transaction do
channel = web_widgets.create!(
website_name: permitted_params[:website_name],
website_url: permitted_params[:website_url]
)
inbox = inboxes.create!(name: permitted_params[:website_name], channel: channel)
render json: inbox
@inbox = inboxes.create!(name: permitted_params[:website_name], channel: channel)
end
end
private
def authorize_request
authorize ::Inbox
end
def inboxes
current_account.inboxes
end