diff options
author | Stan Hu <stanhu@gmail.com> | 2017-07-10 15:05:56 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-07-10 15:08:07 -0700 |
commit | 1f0ee9ca1912e6ea73015c5edd910b489e9c21a0 (patch) | |
tree | 50dc088abe2f454e26e72452ee4ffbe5108d17cc /lib | |
parent | ef526ff33c01d75af5d24e4f13630213815d74d3 (diff) | |
download | gitlab-ce-1f0ee9ca1912e6ea73015c5edd910b489e9c21a0.tar.gz |
Fix sort ordering with merge request APIsh-improve-mr-api
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/merge_requests.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index 9fd557e9cda..1a3fdb66f3f 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -44,10 +44,9 @@ module API args[:label_name] = args.delete(:labels) merge_requests = MergeRequestsFinder.new(current_user, args).execute - merge_requests = paginate(merge_requests) - .preload(:notes, :target_project, :author, :assignee, :milestone, :merge_request_diff, :labels) - - merge_requests.reorder(args[:order_by] => args[:sort]) + merge_requests = merge_requests.reorder(args[:order_by] => args[:sort]) + paginate(merge_requests) + .preload(:notes, :target_project, :author, :assignee, :milestone, :merge_request_diff, :labels) end params :optional_params_ce do |