feat: allow adding custom attributes to conversations from the SDK (#6782)
* feat: add conversation attributes method to sdk and widget app * feat: add endpoints to update custom attributes * refactor: update SDK api * feat: add api and actions for conversation updates * fix: error message * test: custom attributes on conversations controller --------- Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -65,6 +65,16 @@ class Api::V1::Widget::ConversationsController < Api::V1::Widget::BaseController
|
||||
head :ok
|
||||
end
|
||||
|
||||
def set_custom_attributes
|
||||
conversation.update!(custom_attributes: permitted_params[:custom_attributes])
|
||||
end
|
||||
|
||||
def destroy_custom_attributes
|
||||
conversation.custom_attributes = conversation.custom_attributes.excluding(params[:custom_attribute])
|
||||
conversation.save!
|
||||
render json: conversation
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def trigger_typing_event(event)
|
||||
|
||||
Reference in New Issue
Block a user