diff options
author | JB Vasseur <jvasseur@gmail.com> | 2018-10-15 23:03:08 +0900 |
---|---|---|
committer | JB Vasseur <jvasseur@gmail.com> | 2018-10-15 23:03:08 +0900 |
commit | 1ae9aefe5572cc62256f28e16163015f075b6c59 (patch) | |
tree | 0f9da6ffd350d58ce5e3085859222f7236d1e113 /lib | |
parent | c47aea75766fe3165cc9530fc9ccb5a4ac615e46 (diff) | |
download | gitlab-ce-1ae9aefe5572cc62256f28e16163015f075b6c59.tar.gz |
Use application finder for Doorkeeper Applications
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/applications.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/api/applications.rb b/lib/api/applications.rb index 9d0f7a093d5..92717e04543 100644 --- a/lib/api/applications.rb +++ b/lib/api/applications.rb @@ -25,24 +25,21 @@ module API end end - # rubocop: disable CodeReuse/ActiveRecord desc 'Get applications' do success Entities::Application end get do - applications = Doorkeeper::Application.where("owner_id IS NULL") + applications = ApplicationsFinder.new.execute present applications, with: Entities::Application end - # rubocop: enable CodeReuse/ActiveRecord - # rubocop: disable CodeReuse/ActiveRecord desc 'Delete an application' delete ':id' do - Doorkeeper::Application.find_by(id: params[:id]).destroy + application = ApplicationsFinder.new(params).execute + application.destroy status 204 end - # rubocop: enable CodeReuse/ActiveRecord end end end |