diff --git a/app/controllers/api/v1/accounts/custom_filters_controller.rb b/app/controllers/api/v1/accounts/custom_filters_controller.rb index f458c018f..b4345bb8a 100644 --- a/app/controllers/api/v1/accounts/custom_filters_controller.rb +++ b/app/controllers/api/v1/accounts/custom_filters_controller.rb @@ -1,6 +1,6 @@ class Api::V1::Accounts::CustomFiltersController < Api::V1::Accounts::BaseController before_action :check_authorization - before_action :fetch_custom_filters, except: [:create] + before_action :fetch_custom_filters, only: [:index] before_action :fetch_custom_filter, only: [:show, :update, :destroy] DEFAULT_FILTER_TYPE = 'conversation'.freeze @@ -9,8 +9,8 @@ class Api::V1::Accounts::CustomFiltersController < Api::V1::Accounts::BaseContro def show; end def create - @custom_filter = current_user.custom_filters.create!( - permitted_payload.merge(account_id: Current.account.id) + @custom_filter = Current.account.custom_filters.create!( + permitted_payload.merge(user: Current.user) ) render json: { error: @custom_filter.errors.messages }, status: :unprocessable_entity and return unless @custom_filter.valid? end @@ -27,14 +27,16 @@ class Api::V1::Accounts::CustomFiltersController < Api::V1::Accounts::BaseContro private def fetch_custom_filters - @custom_filters = current_user.custom_filters.where( - account_id: Current.account.id, + @custom_filters = Current.account.custom_filters.where( + user: Current.user, filter_type: permitted_params[:filter_type] || DEFAULT_FILTER_TYPE ) end def fetch_custom_filter - @custom_filter = @custom_filters.find(permitted_params[:id]) + @custom_filter = Current.account.custom_filters.where( + user: Current.user + ).find(permitted_params[:id]) end def permitted_payload diff --git a/app/controllers/concerns/access_token_auth_helper.rb b/app/controllers/concerns/access_token_auth_helper.rb index 2ee9f9854..9b0f9021f 100644 --- a/app/controllers/concerns/access_token_auth_helper.rb +++ b/app/controllers/concerns/access_token_auth_helper.rb @@ -1,6 +1,6 @@ module AccessTokenAuthHelper BOT_ACCESSIBLE_ENDPOINTS = { - 'api/v1/accounts/conversations' => %w[toggle_status toggle_priority create update], + 'api/v1/accounts/conversations' => %w[toggle_status toggle_priority create update custom_attributes], 'api/v1/accounts/conversations/messages' => ['create'], 'api/v1/accounts/conversations/assignments' => ['create'] }.freeze diff --git a/app/javascript/dashboard/i18n/locale/en/generalSettings.json b/app/javascript/dashboard/i18n/locale/en/generalSettings.json index e6800820b..7da76df18 100644 --- a/app/javascript/dashboard/i18n/locale/en/generalSettings.json +++ b/app/javascript/dashboard/i18n/locale/en/generalSettings.json @@ -70,7 +70,7 @@ }, "AUTO_RESOLVE_IGNORE_WAITING": { "LABEL": "Exclude unattended conversations", - "HELP": "If toggled, the system will not resolve conversations that have been waiting for an agent reply." + "HELP": "When enabled, the system will skip resolving conversations that are still waiting for an agent’s reply." }, "AUTO_RESOLVE_DURATION": { "LABEL": "Inactivity duration for resolution", diff --git a/app/javascript/portal/components/TableOfContents.vue b/app/javascript/portal/components/TableOfContents.vue index 16da81f71..ec7ccd895 100644 --- a/app/javascript/portal/components/TableOfContents.vue +++ b/app/javascript/portal/components/TableOfContents.vue @@ -94,8 +94,8 @@ export default {