Skip to content

Commit

Permalink
Fix bug in HealthFacilitiesController#retrieve_patsr_approved_facilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Khoa-V-Nguyen committed Dec 20, 2024
1 parent 2c86d78 commit da56634
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def search
end
end

patsr_approved_codes = retrieve_patsr_approved_facilities.pluck(:FacilityCode)
patsr_approved_codes = retrieve_patsr_approved_facilities[:Data].pluck(:FacilityCode)

filtered_results = WillPaginate::Collection.create(
api_results.current_page,
Expand All @@ -42,8 +42,7 @@ def show
private

def retrieve_patsr_approved_facilities
data = Crm::CacheData.new.fetch_and_cache_data(endpoint: 'Facilities', cache_key: 'Facilities', payload: {})
JSON.parse(data, symbolize_names: true)[:Data]
Crm::CacheData.new.fetch_and_cache_data(endpoint: 'Facilities', cache_key: 'Facilities', payload: {})
end

def api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@

let(:cache_data_instance) { Crm::CacheData.new }
let(:patsr_facilities) do
File.read('modules/ask_va_api/config/locales/get_facilities_mock_data.json')
data = File.read('modules/ask_va_api/config/locales/get_facilities_mock_data.json')
JSON.parse(data, symbolize_names: true)
end

before do
Expand Down

0 comments on commit da56634

Please sign in to comment.