Commit a3c82d78 authored by Rajendra Kadam's avatar Rajendra Kadam

Use DestroyService for deleting SSH keys via API from user

parent 23168b42
......@@ -750,7 +750,10 @@ module API
key = current_user.keys.find_by(id: params[:key_id])
not_found!('Key') unless key
destroy_conditionally!(key)
destroy_conditionally!(key) do |key|
destroy_service = ::Keys::DestroyService.new(current_user)
destroy_service.execute(key)
end
end
# rubocop: enable CodeReuse/ActiveRecord
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment