add: remove public key from api

This commit is contained in:
yystopf 2021-07-23 10:54:21 +08:00
parent fcc7736c34
commit f5e07ab3ec
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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