65 Needs to be completed before this ticket can begin
DescriptionFacilityForm is used to make the search for cafes, but the submit function is currently just a placeholder. This ticket is therefore needed in order to perform the fetch request to the BE to retrieve the relevant matching cafe data.
AC
[x] Install and import axios, npm i axios
[x] Make an axios request in a useEffect to the cafeAPI
NB: Use the baseUrl variable in the utils folder for the axios request
[x] Console.log the resulting data
In the axios request params please include
[x] location (required) - If #38 is completed, use the location state here, otherwise HARD CODE: 51.5074,-0.1278
[ ] If there are requiredFacilities, send requiredFacilities as params. If there are NO requiredFacilities, then facilities MUST be included
API Route to retrieve selected Cafes/api/v1.0/cafes/selected
Example URL with request params shown here
localhost:8080/api/v1.0/cafes/selected?requiredFacilities=outdoor%20area,wi-fi&facilities=toilets&userLocation=51.5074,-0.1278
65 Needs to be completed before this ticket can begin
Description
FacilityForm
is used to make the search for cafes, but the submit function is currently just a placeholder. This ticket is therefore needed in order to perform the fetch request to the BE to retrieve the relevant matching cafe data.AC
npm i axios
useEffect
to the cafeAPI NB: Use thebaseUrl
variable in theutils
folder for the axios requestIn the axios request params please include
requiredFacilities
, send requiredFacilities as params. If there are NO requiredFacilities, thenfacilities
MUST be includedAPI Route to retrieve selected Cafes
/api/v1.0/cafes/selected
Example URL with request params shown here localhost:8080/api/v1.0/cafes/selected?requiredFacilities=outdoor%20area,wi-fi&facilities=toilets&userLocation=51.5074,-0.1278
NB: Feel free to ask Pablo or Sidra