diff options
author | Sean McGivern <sean@gitlab.com> | 2019-08-06 17:27:46 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-08-08 17:10:41 +0100 |
commit | e6dc5168b86d613e3334fa55618e394308bf55bf (patch) | |
tree | 6ad67848dfbe81949474e20f5224edf055c273cb /lib/api/helpers/label_helpers.rb | |
parent | 26087322713e2949f2bf207798512374757a484c (diff) | |
download | gitlab-ce-e6dc5168b86d613e3334fa55618e394308bf55bf.tar.gz |
Remove label issue and MR counts from default API responsesspeed-up-labels-api
These counts significantly increase the load time for these
requests. Users can now opt in to receiving the counts by setting
`with_counts=true` in requests. This is a breaking change, but hopefully
a fairly minor one.
Diffstat (limited to 'lib/api/helpers/label_helpers.rb')
-rw-r--r-- | lib/api/helpers/label_helpers.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/helpers/label_helpers.rb b/lib/api/helpers/label_helpers.rb index c11e7d614ab..896b0aba52b 100644 --- a/lib/api/helpers/label_helpers.rb +++ b/lib/api/helpers/label_helpers.rb @@ -19,7 +19,11 @@ module API end def get_labels(parent, entity) - present paginate(available_labels_for(parent)), with: entity, current_user: current_user, parent: parent + present paginate(available_labels_for(parent)), + with: entity, + current_user: current_user, + parent: parent, + with_counts: params[:with_counts] end def create_label(parent, entity) |