Skip to content

Commit

Permalink
fix: Handle empty status in conversation controller (#8091)
Browse files Browse the repository at this point in the history
Fixes CW-2644
  • Loading branch information
vishnu-narayanan committed Oct 12, 2023
1 parent 415bb23 commit ae52ca8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -60,7 +60,7 @@ def transcript
end

def toggle_status
if params[:status]
if params[:status].present?
set_conversation_status
@status = @conversation.save!
else
Expand Down
Expand Up @@ -340,11 +340,12 @@
create(:inbox_member, user: agent, inbox: conversation.inbox)
end

it 'toggles the conversation status' do
it 'toggles the conversation status if status is empty' do
expect(conversation.status).to eq('open')

post "/api/v1/accounts/#{account.id}/conversations/#{conversation.display_id}/toggle_status",
headers: agent.create_new_auth_token,
params: { status: '' },
as: :json

expect(response).to have_http_status(:success)
Expand Down

0 comments on commit ae52ca8

Please sign in to comment.