19ab0fe108
* Chore: Enable Users to create multiple accounts Addresses: #402 - migrations to split roles and other attributes from users table - make changes in code to accommodate this change Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
11 lines
439 B
Ruby
11 lines
439 B
Ruby
class Api::V1::Accounts::Conversations::AssignmentsController < Api::BaseController
|
|
before_action :set_conversation, only: [:create]
|
|
|
|
# assign agent to a conversation
|
|
def create
|
|
# if params[:assignee_id] is not a valid id, it will set to nil, hence unassigning the conversation
|
|
assignee = current_account.users.find_by(id: params[:assignee_id])
|
|
@conversation.update_assignee(assignee)
|
|
render json: assignee
|
|
end
|
|
end
|