summaryrefslogtreecommitdiff
path: root/app/controllers/groups/releases_controller.rb
blob: 500c57a6f3e6a9cd9413c4b8efff787a4bf85fd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

module Groups
  class ReleasesController < Groups::ApplicationController
    def index
      respond_to do |format|
        format.json do
          render json: ReleaseSerializer.new.represent(releases)
        end
      end
    end

    private

    def releases
      ReleasesFinder
        .new(@group, current_user, { include_subgroups: true })
        .execute(preload: false)
        .page(params[:page])
        .per(30)
    end
  end
end