fix: Assignment V2 controller fix (#12415)

This commit is contained in:
Tanmay Deep Sharma
2025-09-11 19:32:33 +07:00
committed by GitHub
parent 052b328a1f
commit e5b8dc251f
4 changed files with 53 additions and 4 deletions

View File

@@ -4,8 +4,8 @@ class Api::V1::Accounts::AgentCapacityPolicies::UsersController < Api::V1::Accou
before_action :fetch_user, only: [:destroy]
def index
@users = Current.account.users.joins(:account_users)
.where(account_users: { agent_capacity_policy_id: @agent_capacity_policy.id })
@users = User.joins(:account_users)
.where(account_users: { account_id: Current.account.id, agent_capacity_policy_id: @agent_capacity_policy.id })
end
def create

View File

@@ -27,7 +27,7 @@ class Api::V1::Accounts::AgentCapacityPoliciesController < Api::V1::Accounts::En
params.require(:agent_capacity_policy).permit(
:name,
:description,
exclusion_rules: [:overall_capacity, { hours: [], days: [] }]
exclusion_rules: [:exclude_older_than_hours, { excluded_labels: [] }]
)
end