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

set up connection between the long and lat from the search field and render the corresponding airtable api data to results page listings #48

Closed
7 of 11 tasks
xIrusux opened this issue Oct 10, 2019 · 0 comments

Comments

@xIrusux
Copy link
Collaborator

xIrusux commented Oct 10, 2019

set up connection between the long and lat from the search field and render the corresponding airtable api data to results page listings:

  • 1. research whether to use postcode logic or long/lat logic
  • 2. retrieve correct data from airtable (dummy data)
  • 3. write some goddamn tests!

pseudo code:

  • 1. retrieve postcode which was entered via searchfield
  • 2. fetch geolocation api to convert postcode to long lat
  • 3. fetch airtable to retrieve all results data
  • 4. filter retrieved listing results data by longitude/ latitude using the haversine formula to filter/reduce by a radius of 50km (on client side) -> this will result in an array of the listings within radius
  • 5. map through array and return corresponding listing data to user (as used here: https://github.com/gminova/portfolio/blob/master/src/components/Projects.js)
  • 6. use React.useEffect to listen for new user postcode input changes in searchbar
  • 7. [Strechgoal: script] write script to avoid hardcoding long/lat of results inside airtable (more info in Airtable Geocoding Cronjob [Stretch] #41
  • 8. [Strechgoal: performance optimisation] add logic to cash most recent 10 searches in local storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants