mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
Fix condition on disclosed attrs presence
This commit is contained in:
parent
b5d175798e
commit
40579a8488
2 changed files with 20 additions and 5 deletions
|
@ -47,11 +47,11 @@ module Api
|
|||
reparsed_request_json = ActiveSupport::JSON.decode(request.body.string)
|
||||
.with_indifferent_access
|
||||
logger.debug 'Reparsed request is following'
|
||||
logger.debug "#{reparsed_request_json}"
|
||||
logger.debug reparsed_request_json.to_s
|
||||
disclosed_attributes = reparsed_request_json[:disclosed_attributes]
|
||||
|
||||
if disclosed_attributes
|
||||
if contact.org?
|
||||
if disclosed_attributes.present? && contact.org?
|
||||
error_msg = "Legal person's data is visible by default and cannot be concealed." \
|
||||
' Please remove this parameter.'
|
||||
render json: { errors: [{ disclosed_attributes: [error_msg] }] }, status: :bad_request
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue