Feature: Website SDK (#653)
Add SDK functions Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
24
app/controllers/api/v1/widget/labels_controller.rb
Normal file
24
app/controllers/api/v1/widget/labels_controller.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
class Api::V1::Widget::LabelsController < Api::V1::Widget::BaseController
|
||||
before_action :set_web_widget
|
||||
before_action :set_contact
|
||||
|
||||
def create
|
||||
conversation.label_list.add(permitted_params[:label])
|
||||
conversation.save!
|
||||
|
||||
head :no_content
|
||||
end
|
||||
|
||||
def destroy
|
||||
conversation.label_list.remove(permitted_params[:id])
|
||||
conversation.save!
|
||||
|
||||
head :no_content
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def permitted_params
|
||||
params.permit(:id, :label, :website_token)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user