Skip to content
This repository has been archived by the owner on Dec 3, 2020. It is now read-only.

Parse the price string into a number for Open Graph extraction #154

Closed
biancadanforth opened this issue Oct 9, 2018 · 0 comments
Closed
Assignees

Comments

@biancadanforth
Copy link
Collaborator

OpenGraph extraction broke when the parsePrice utility function was added.

This is because, at the same time parsePrice was added, the extractedProduct propTypes shape was modified to expect extractedProduct.price to be of type Number rather than String.

While Fathom and fallback extraction both make use of parsePrice, OpenGraph extraction currently does not. It should be added so that its extraction does not fail the propTypes check.

@biancadanforth biancadanforth self-assigned this Oct 9, 2018
biancadanforth added a commit that referenced this issue Oct 9, 2018
This PR depends on PR#143, so merge that one first.

This is a bit of a moot point for the MVP, since #70 restricts extraction to our five supported sites, none of which make use of Open Graph meta tags, however, that may change, and the fix was quick.

Note: To test this, comment out the other extraction methods in './src/extraction/index.js' and the allowlist check in that file's 'main' function, then visit a Crate and Barrel product page.
biancadanforth added a commit that referenced this issue Oct 11, 2018
Fix #154: Parse Open Graph price string to a number
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant