diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /lib/api/releases.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'lib/api/releases.rb')
-rw-r--r-- | lib/api/releases.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/api/releases.rb b/lib/api/releases.rb index 3c38721129f..3bd6ea77403 100644 --- a/lib/api/releases.rb +++ b/lib/api/releases.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module API - class Releases < Grape::API::Instance + class Releases < ::API::Base include PaginationParams RELEASE_ENDPOINT_REQUIREMENTS = API::NAMESPACE_OR_PROJECT_REQUIREMENTS @@ -19,9 +19,13 @@ module API end params do use :pagination + optional :order_by, type: String, values: %w[released_at created_at], default: 'released_at', + desc: 'Return releases ordered by `released_at` or `created_at`.' + optional :sort, type: String, values: %w[asc desc], default: 'desc', + desc: 'Return releases sorted in `asc` or `desc` order.' end get ':id/releases' do - releases = ::ReleasesFinder.new(user_project, current_user).execute + releases = ::ReleasesFinder.new(user_project, current_user, declared_params.slice(:order_by, :sort)).execute present paginate(releases), with: Entities::Release, current_user: current_user end @@ -152,7 +156,7 @@ module API end def authorize_create_evidence! - # This is a separate method so that EE can extend its behaviour + # extended in EE end def release @@ -160,15 +164,15 @@ module API end def log_release_created_audit_event(release) - # This is a separate method so that EE can extend its behaviour + # extended in EE end def log_release_updated_audit_event - # This is a separate method so that EE can extend its behaviour + # extended in EE end def log_release_milestones_updated_audit_event - # This is a separate method so that EE can extend its behaviour + # extended in EE end end end |