Browse Source

add: remove public key from api

tags/v3.1.5
yystopf 4 years ago
parent
commit
f5e07ab3ec
2 changed files with 4 additions and 2 deletions
  1. +2
    -1
      app/controllers/public_keys_controller.rb
  2. +2
    -1
      app/services/gitea/user/keys/delete_service.rb

+ 2
- 1
app/controllers/public_keys_controller.rb View File

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


+ 2
- 1
app/services/gitea/user/keys/delete_service.rb View File

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


Loading…
Cancel
Save