diff --git a/app/views/api/users/companies/_company.json.jbuilder b/app/views/api/users/companies/_company.json.jbuilder index 531c392d6e2..9d61e3027fe 100644 --- a/app/views/api/users/companies/_company.json.jbuilder +++ b/app/views/api/users/companies/_company.json.jbuilder @@ -7,5 +7,5 @@ json.logo_url company.logo_url json.users_url company_users_url(company) allowed_targets = %w[all trainee adviser graduate mentor] -users = company.users.users_role(@target, allowed_targets: allowed_targets).order(:id) +users = company.users.users_role(target, allowed_targets: allowed_targets).order(:id) json.users users, partial: "api/users/user", as: :user diff --git a/app/views/api/users/companies/index.json.jbuilder b/app/views/api/users/companies/index.json.jbuilder index 50ee82d4b90..90e03a0ddbb 100644 --- a/app/views/api/users/companies/index.json.jbuilder +++ b/app/views/api/users/companies/index.json.jbuilder @@ -1,3 +1,3 @@ # frozen_string_literal: true -json.array! @companies, partial: "api/users/companies/company", as: :company +json.array! @companies, partial: "api/users/companies/company", as: :company, target: @target