mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
add: remove public key from api
This commit is contained in:
@@ -32,7 +32,8 @@ class PublicKeysController < ApplicationController
|
||||
|
||||
def destroy
|
||||
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
|
||||
else
|
||||
render_error
|
||||
|
||||
@@ -7,7 +7,8 @@ class Gitea::User::Keys::DeleteService < Gitea::ClientService
|
||||
end
|
||||
|
||||
def call
|
||||
delete(url, params)
|
||||
response = delete(url, params)
|
||||
render_response(response)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user