X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/935c8f81f0a041a58bbb45602ef44cdd6673163a..436f5c768dbc97135490b6477efd1ff0482a9dda:/services/api/app/controllers/application_controller.rb diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb index cdfbdbbcc1..22851191b6 100644 --- a/services/api/app/controllers/application_controller.rb +++ b/services/api/app/controllers/application_controller.rb @@ -506,10 +506,16 @@ class ApplicationController < ActionController::Base :limit => @limit, :items => @objects.as_api_response(nil, {select: @select}) } - if @objects.respond_to? :except - list[:items_available] = @objects. - except(:limit).except(:offset). - count(:id, distinct: true) + case params[:count] + when nil, '', 'exact' + if @objects.respond_to? :except + list[:items_available] = @objects. + except(:limit).except(:offset). + count(:id, distinct: true) + end + when 'none' + else + raise ArgumentError.new("count parameter must be 'exact' or 'none'") end list end @@ -572,6 +578,7 @@ class ApplicationController < ActionController::Base distinct: { type: 'boolean', required: false }, limit: { type: 'integer', required: false, default: DEFAULT_LIMIT }, offset: { type: 'integer', required: false, default: 0 }, + count: { type: 'string', required: false, default: 'exact' }, } end