feat: Add an option to disable endConversation button (#4352)

This commit is contained in:
Pranav Raj S
2022-04-06 13:54:55 +05:30
committed by GitHub
parent 821b953ee9
commit 0b03e4b296
10 changed files with 81 additions and 10 deletions

View File

@@ -45,7 +45,10 @@ class Api::V1::Widget::ConversationsController < Api::V1::Widget::BaseController
end
def toggle_status
head :not_found && return if conversation.nil?
return head :not_found if conversation.nil?
return head :forbidden unless @web_widget.end_conversation?
unless conversation.resolved?
conversation.status = :resolved
conversation.save