push links to algolia

This commit is contained in:
Sara Vieira
2018-11-27 10:02:09 +01:00
parent ff1a4189b4
commit 277165b73c
4 changed files with 9 additions and 10074 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,10 @@ const newArray = data.reduce((acc, curr) => {
if (acc.find(a => curr.info.place_id === a.info.place_id)) {
const current = acc.find(a => curr.info.place_id === a.info.place_id)
if (curr.link) {
current.link = curr.link
}
if (!current.company.includes(curr.company))
current.company.push(curr.company)
} else {

View File

@@ -43,15 +43,14 @@
"osmosis": "^1.1.8",
"preact-cli": "^2.2.1",
"prettier": "^1.15.2",
"react-country-flag": "^1.0.1"
"dotenv": "^6.1.0",
"isomorphic-fetch": "^2.2.1",
"require-dir": "^1.2.0"
},
"dependencies": {
"algoliasearch": "^3.30.0",
"dotenv": "^6.1.0",
"emotion": "^9.2.12",
"emotion-theming": "^9.2.9",
"isomorphic-fetch": "^2.2.1",
"limiter": "^1.1.3",
"lodash.uniqby": "^4.7.0",
"mobile-detect": "^1.4.3",
"preact": "^8.3.1",
@@ -61,7 +60,7 @@
"react-emotion": "^9.2.12",
"react-emotion-flexboxgrid": "^9.0.0",
"remove-accents": "^0.4.2",
"require-dir": "^1.1.0"
"react-country-flag": "^1.0.1"
},
"lint-staged": {
"*.js": [

View File

@@ -15,7 +15,6 @@ import { search } from '../../utils/algolia'
import edgeCases from '../../utils/edgeCases'
import ReactCountryFlag from 'react-country-flag'
import { getAppStoreLink } from '../../utils/appStores'
import uberData from '../../../data/single/uber'
class City extends Component {
state = {
@@ -54,8 +53,6 @@ class City extends Component {
render({}, { cities, loaded }) {
const city = cities[0]
const match =
city && uberData.find(a => a.info.place_id === city.info.place_id)
if (!loaded) {
return (
@@ -78,7 +75,7 @@ class City extends Component {
</Wrapper>,
<a
style={{ textDecoration: 'none' }}
href={match ? `https://www.uber.com${match.link}` : null}
href={`https://www.uber.com${city.link}`}
target="_blank"
rel="noopener noreferrer"
>