feat: Business hour Inbox APIs (#1821)

* feat: Business hour Inbox APIs
This commit is contained in:
Sojan Jose
2021-02-23 12:11:15 +05:30
committed by GitHub
parent a3b0de63de
commit 0e721653e5
14 changed files with 86 additions and 23 deletions

View File

@@ -23,6 +23,7 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
def update
@inbox.update(inbox_update_params.except(:channel))
@inbox.update_working_hours(params.permit(working_hours: Inbox::OFFISABLE_ATTRS)[:working_hours]) if params[:working_hours]
return unless @inbox.channel.is_a?(Channel::WebWidget) && inbox_update_params[:channel].present?
@inbox.channel.update!(inbox_update_params[:channel])
@@ -80,7 +81,7 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
def inbox_update_params
params.permit(:enable_auto_assignment, :name, :avatar, :greeting_message, :greeting_enabled,
:working_hours_enabled, :out_of_office_message,
:working_hours_enabled, :out_of_office_message, :timezone,
channel: [
:website_url,
:widget_color,