-
Notifications
You must be signed in to change notification settings - Fork 125
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
[10-10CG] Use CG facilities endpoint instead of hca endpoint #32038
Conversation
…e. Hide Load more facilities button when no more exist
@@ -51,7 +51,7 @@ export const fetchFacilities = async ({ | |||
}) => { | |||
const baseUrl = `${ | |||
environment.API_URL | |||
}/v0/health_care_applications/facilities?type=health`; | |||
}/v0/caregivers_assistance_claims/facilities?type=health`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New vets-api
endpoint for facilities
> | ||
Load more facilities | ||
</button> | ||
{hasMoreFacilities() && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only render Load more facilities
button if there are more facilities to load
@@ -67,8 +67,15 @@ export const fetchFacilities = async ({ | |||
|
|||
return fetchRequest | |||
.then(response => { | |||
return response.map(facility => { | |||
const { physical } = facility?.address; | |||
if (!response?.data?.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not really happen now, but I added logic to handle if the data object is not returned (this can happen on the backend if the pagination values are passed in out of range). If you try to send the searchbox garbage (ie search for 'my city` or something it will generally return this same response but from the mapbox api call).
@@ -83,12 +90,18 @@ export const fetchFacilities = async ({ | |||
|
|||
// Return a new facility object with the updated address | |||
return { | |||
...facility, | |||
...attributes, | |||
id: facility.id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The id is not passed in the response object attributes
, so I am adding it to the response here.
@@ -16,7 +16,7 @@ export const setupPerTest = () => { | |||
cy.intercept('POST', 'v0/form1010cg/attachments', mockUpload); | |||
cy.intercept( | |||
'GET', | |||
'/v0/health_care_applications/facilities?*', | |||
'/v0/caregivers_assistance_claims/facilities?*', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New api endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good Brandon. Nice work!
45c31a4
45c31a4
to
616d30b
Compare
Summary
Load more facilities
button should be loaded. The data object response is a little different format, so that is the bulk of changes in this PR.caregiver_use_facilities_API
.Related issue(s)
Testing done
Screenshots
No visual changes other than
Load more facilities
button is not rendered if there are no more facilities to loadWhat areas of the site does it impact?
10-10CG
Acceptance criteria
Quality Assurance & Testing
Error Handling
Authentication