feat(inboxes): add inbox disable toggle
This commit is contained in:
@@ -3,6 +3,7 @@ class Api::V1::Widget::BaseController < ApplicationController
|
||||
include WebsiteTokenHelper
|
||||
|
||||
before_action :set_web_widget
|
||||
before_action :ensure_inbox_active
|
||||
before_action :set_contact
|
||||
|
||||
private
|
||||
@@ -86,4 +87,8 @@ class Api::V1::Widget::BaseController < ApplicationController
|
||||
message_type: :incoming
|
||||
}
|
||||
end
|
||||
|
||||
def ensure_inbox_active
|
||||
render_inbox_disabled_error unless @web_widget.inbox.active?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user