Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPG-344-Remove-Address-And-Contact-From-Responses #588

Merged
merged 2 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/api/v1/manage_organisations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ManageOrganisationsController < ActionController::API
before_action :validate_params

def search_organisation
scheme_result = api_result
scheme_result = api_result.except(:address, :contactPoint)
# While PPON is being developed, we want any related CII functionality to be inaccessible temporarily.
if scheme_result.blank? || params[:scheme].upcase == Common::AdditionalIdentifier::SCHEME_PPON
render json: '', status: :not_found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def search_organisation
result = Common::RegisteredOrganisationResponse.new(params[:ccs_org_id], hidden: access_to_hidden_identifiers).response_payload if params[:ccs_org_id]

if result.present?
render json: build_response(result), status: :ok
render json: result[0], status: :ok
else
render json: '', status: :not_found
end
Expand All @@ -26,12 +26,6 @@ def search_organisation_by_scheme
return result[:ccs_org_id] if result.present? && result[:ccs_org_id].present? && !result['hidden']
end

def build_response(result)
api_result = SearchApi.new(result[0][:identifier][:id], result[0][:identifier][:scheme], address_lookup: true).call
result[0][:address] = Common::AddressHelper.new(api_result).build_response
result[0]
end

def validate_params
return validate_scheme if params[:ccs_org_id].include? '-'

Expand Down