diff options
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 83c335a3248..3b1d239398f 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -157,6 +157,8 @@ module API [options[:with].prepare_relation(projects, options), options] end + Preloaders::UserMaxAccessLevelInProjectsPreloader.new(records, current_user).execute if current_user + present records, options end @@ -608,6 +610,10 @@ module API users = users.search(params[:search]) if params[:search].present? users = users.where_not_in(params[:skip_users]) if params[:skip_users].present? + if Feature.enabled?(:sort_by_project_users_by_project_authorizations_user_id, user_project, default_enabled: :yaml) + users = users.order('project_authorizations.user_id' => :asc) # rubocop: disable CodeReuse/ActiveRecord + end + present paginate(users), with: Entities::UserBasic end |