Commit d8b46b35 authored by Sean McGivern's avatar Sean McGivern

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

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

See merge request gitlab-org/gitlab!35033
parents 894fe92a 8bba7438
---
title: Use GpgKeys::DestroyService when a user deletes GPG keys for themselves via the API
merge_request: 35033
author: Rajendra Kadam
type: fixed
......@@ -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