diff options
| author | Achilleas Pipinellis <axil@gitlab.com> | 2019-08-20 20:22:43 +0200 |
|---|---|---|
| committer | Achilleas Pipinellis <axil@gitlab.com> | 2019-08-20 20:22:43 +0200 |
| commit | e61308ce1d82e12e5087371469baea4a452875d1 (patch) | |
| tree | 62551a3ae4eab75e5af7e3b35358c07a51b2132f /lib/api/environments.rb | |
| parent | 4f323bb62fbe71a4352de25cab141f361a3fe1a6 (diff) | |
| parent | 2989ed078c1d45b0959dcecb1bc3c8f4740a3c0d (diff) | |
| download | gitlab-ce-docs-patch-71.tar.gz | |
Merge branch 'master' into docs-patch-71docs-patch-71
Diffstat (limited to 'lib/api/environments.rb')
| -rw-r--r-- | lib/api/environments.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/api/environments.rb b/lib/api/environments.rb index 6cd43923559..ec58b3b7bb9 100644 --- a/lib/api/environments.rb +++ b/lib/api/environments.rb @@ -18,11 +18,16 @@ module API end params do use :pagination + optional :name, type: String, desc: 'Returns the environment with this name' + optional :search, type: String, desc: 'Returns list of environments matching the search criteria' + mutually_exclusive :name, :search, message: 'cannot be used together' end get ':id/environments' do authorize! :read_environment, user_project - present paginate(user_project.environments), with: Entities::Environment, current_user: current_user + environments = ::EnvironmentsFinder.new(user_project, current_user, params).find + + present paginate(environments), with: Entities::Environment, current_user: current_user end desc 'Creates a new environment' do |
