Skip to content

Commit

Permalink
Refs #38127 - Add sort options to host bootc_images endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
lfu committed Jan 16, 2025
1 parent fcd6cdb commit 0f63d27
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/controllers/katello/api/v2/host_bootc_images_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@ def bootc_images
bootc_image_map = bootc_host_image_map
paged_images = bootc_image_map.to_a.paginate(page: page, per_page: per_page)
results = paged_images.collect { |image| { bootc_booted_image: image[0], digests: image[1] } }
render json: { total: bootc_image_map.size, page: page, per_page: per_page, subtotal: bootc_image_map.size, results: results}
render json: {
total: bootc_image_map.size,
page: page,
per_page: per_page,
subtotal: bootc_image_map.size,
sort: {
by: params[:sort_by],
order: params[:sort_order],
},
results: results,
}
end

private
Expand Down

0 comments on commit 0f63d27

Please sign in to comment.