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

BE | Ask VA Api: Fix bug in HealthFacilitiesController#retrieve_patsr_approved_facilities #19984

Merged
merged 1 commit into from
Dec 20, 2024
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
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
Loading