Commit 6a86d2aa authored by Rajendra Kadam's avatar Rajendra Kadam

Use GpgKeys::DestroyService when a user deletes a GPG keys for themselves

parent f4462041
......@@ -829,9 +829,10 @@ module API
key = current_user.gpg_keys.find_by(id: params[:key_id])
not_found!('GPG Key') unless key
key.destroy
no_content!
destroy_conditionally!(key) do |key|
destroy_service = ::GpgKeys::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