mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 07:04:47 +02:00
REPP: Add contact:destroy action
This commit is contained in:
parent
516b2180ca
commit
f9bef781ab
5 changed files with 104 additions and 30 deletions
|
@ -1,7 +1,7 @@
|
|||
module Repp
|
||||
module V1
|
||||
class ContactsController < BaseController
|
||||
before_action :find_contact, only: %i[show update]
|
||||
before_action :find_contact, only: %i[show update destroy]
|
||||
|
||||
## GET /repp/v1/contacts
|
||||
def index
|
||||
|
@ -53,6 +53,16 @@ module Repp
|
|||
render_success(create_update_success_body)
|
||||
end
|
||||
|
||||
def destroy
|
||||
action = Actions::ContactDelete.new(@contact, params[:legal_document])
|
||||
unless action.call
|
||||
handle_errors(@contact)
|
||||
return
|
||||
end
|
||||
|
||||
render_success
|
||||
end
|
||||
|
||||
def contact_addr_present?
|
||||
return false unless contact_addr_params.key?(:addr)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue