Class: NewsmastMastodon::Api::V1::Patchwork::AccountDeletionController

Inherits:
Api::BaseController
  • Object
show all
Includes:
Concerns::ApiResponseHelper
Defined in:
app/controllers/newsmast_mastodon/api/v1/patchwork/account_deletion_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



9
10
11
12
13
14
15
16
17
# File 'app/controllers/newsmast_mastodon/api/v1/patchwork/account_deletion_controller.rb', line 9

def destroy
  if @account.nil?
    render_error("api.errors.not_found", :not_found)
    return
  end

  DeleteAccountService.new.call(@account, reserve_email: false, reserve_username: false)
  render_success({}, 'api.messages.deleted', :accepted)
end