Allow new call to RemoteCensusApi on CensusCaller
When Setting["feature.remote_census"] is active, we allow and ability the calls to new RemoteCensusAPI througth CensusCaller
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
class CensusCaller
|
||||
|
||||
def call(document_type, document_number)
|
||||
response = CensusApi.new.call(document_type, document_number)
|
||||
if Setting["feature.remote_census"].present?
|
||||
response = RemoteCensusApi.new.call(document_type, document_number)
|
||||
else
|
||||
response = CensusApi.new.call(document_type, document_number)
|
||||
end
|
||||
response = LocalCensus.new.call(document_type, document_number) unless response.valid?
|
||||
|
||||
response
|
||||
|
||||
Reference in New Issue
Block a user