mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 06:34:46 +02:00
Update registry lock controller to also return special serialization
This commit is contained in:
parent
ce8451d004
commit
5e5162e44e
5 changed files with 28 additions and 13 deletions
|
@ -1,3 +1,5 @@
|
|||
require 'serializers/registrant_api/domain'
|
||||
|
||||
module Api
|
||||
module V1
|
||||
module Registrant
|
||||
|
@ -7,7 +9,8 @@ module Api
|
|||
|
||||
def create
|
||||
if @domain.apply_registry_lock
|
||||
render json: @domain
|
||||
serializer = Serializers::RegistrantApi::Domain.new(@domain)
|
||||
render json: serializer.to_json
|
||||
else
|
||||
render json: { errors: [{ base: ['Domain cannot be locked'] }] },
|
||||
status: :unprocessable_entity
|
||||
|
@ -16,7 +19,8 @@ module Api
|
|||
|
||||
def destroy
|
||||
if @domain.remove_registry_lock
|
||||
render json: @domain
|
||||
serializer = Serializers::RegistrantApi::Domain.new(@domain)
|
||||
render json: serializer.to_json
|
||||
else
|
||||
render json: { errors: [{ base: ['Domain is not locked'] }] },
|
||||
status: :unprocessable_entity
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue