-
Notifications
You must be signed in to change notification settings - Fork 230
feat(postcodes): expose postcodes array in suggestions #622
Conversation
|
||
Examples: | ||
|
||
- `["94102","94103","94104",...]` |
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.
Format with spaces
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.
- city | ||
- postcode | ||
- county | ||
- administrative |
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.
👍
@@ -83,7 +121,8 @@ export default function formatHit({ | |||
lat: hit._geoloc.lat, | |||
lng: hit._geoloc.lng, | |||
}, | |||
postcode: hit.postcode && hit.postcode[0], | |||
postcode, | |||
postcodes: hit.postcode ? hit.postcode : undefined, |
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.
Shouldn't it be postcodes: hit.postcodes ? hit.postcodes : undefined,
?
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 raw response field for the postcode array is postcode
, so it's not a typo!
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.
Oh nice catch 👍
a1fcf7c
to
d796cd4
Compare
Let me know what you think of the formatting changes @raphi |
Summary
This PR exposes the postcodes array in the suggestion object.
It now also returns the best matching postcode as
postcode
when possible.the postcode field is now also included in the highlight object.
Result
exposes the postcodes field
updates tests to include postcodes array
updates the documentation to include section about postcodes
update landing formatting with new postcodes object (truncated for readability)