add: remove public key from api
This commit is contained in:
parent
fcc7736c34
commit
f5e07ab3ec
|
@ -32,7 +32,8 @@ class PublicKeysController < ApplicationController
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
return render_not_found unless @public_key.present?
|
return render_not_found unless @public_key.present?
|
||||||
if @public_key.destroy
|
result = Gitea::User::Keys::DeleteService.call(current_user.gitea_token, @public_key.id)
|
||||||
|
if result[0] == 204
|
||||||
render_ok
|
render_ok
|
||||||
else
|
else
|
||||||
render_error
|
render_error
|
||||||
|
|
|
@ -7,7 +7,8 @@ class Gitea::User::Keys::DeleteService < Gitea::ClientService
|
||||||
end
|
end
|
||||||
|
|
||||||
def call
|
def call
|
||||||
delete(url, params)
|
response = delete(url, params)
|
||||||
|
render_response(response)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in New Issue