Project

General

Profile

Revision 40825a11

Added by Marek Hulán over 4 years ago

Fixes #21893 - fix listing containers for specific CR

View differences:

app/controllers/api/v2/containers_controller.rb
17 17
      param_group :search_and_pagination, ::Api::V2::BaseController
18 18

  
19 19
      def index
20
        compute_resource_id = params[:compute_resource_id].tap do |id|
21
          id.present? ? { :compute_resource_id => id } : nil
22
        end
23
        scoped = Container.where(compute_resource_id)
24
        @containers = scoped.search_for(params[:search], :order => params[:order])
20
        scope = resource_scope
21
        scope = scope.where(:compute_resource => params[:compute_resource_id]) if params[:compute_resource_id].present?
22
        @containers = scope.search_for(params[:search], :order => params[:order])
25 23
                      .paginate(:page => params[:page])
26 24
      end
27 25

  

Also available in: Unified diff