diff options
author | JB Vasseur <jvasseur@gmail.com> | 2018-10-11 19:54:15 +0900 |
---|---|---|
committer | JB Vasseur <jvasseur@gmail.com> | 2018-10-11 19:54:15 +0900 |
commit | 6dd4ae0d87fd9a30ab9ce36b5127be36929f5692 (patch) | |
tree | 284c71c5f9f6b2db8bf10160bc20de98c96bdcd8 /lib/api/applications.rb | |
parent | 3421f1d124ecf34c620d75488c22fa3fab602721 (diff) | |
download | gitlab-ce-6dd4ae0d87fd9a30ab9ce36b5127be36929f5692.tar.gz |
Support GET /applications and DELETE /applications/:id endpoints #52559
Diffstat (limited to 'lib/api/applications.rb')
-rw-r--r-- | lib/api/applications.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/api/applications.rb b/lib/api/applications.rb index f29cd7fc003..1c940af95d7 100644 --- a/lib/api/applications.rb +++ b/lib/api/applications.rb @@ -24,6 +24,23 @@ module API render_validation_error! application end end + + desc 'Get applications' do + success Entities::ApplicationWithSecret + end + get do + applications = Doorkeeper::Application.all + present applications, with: Entities::Application + end + + # rubocop: disable CodeReuse/ActiveRecord + desc 'Delete an application' + delete ':id' do + Doorkeeper::Application.find_by(id: params[:id]).destroy + + status 204 + end + # rubocop: enable CodeReuse/ActiveRecord end end end |