Commit 6a0e0980 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'services-usage-4' into 'master'

Use `Keys::DestroyService` for deleting an SSH key when a user deletes a key via the API

See merge request gitlab-org/gitlab!34718
parents 87577077 57de2a98
---
title: Use Keys::DestroyService for deleting an SSH key when a user deletes a key via the API
merge_request: 34718
author: Rajendra Kadam
type: fixed
......@@ -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