Merge branch 'bugfix/showscore' into 'develop'

show_match_value now setted through env

See merge request tjohn/cc-data!22
This commit is contained in:
Timo Volkmann 2020-06-23 14:14:07 +02:00
commit 5d2f64a688
2 changed files with 4 additions and 3 deletions

View File

@ -5,4 +5,5 @@ DB_USER=root
DB_PASSWORD=devtest
DB_PORT=3306
DATABASE=travopti
GOOGLE_CLOUD_APIS=AIzaSyCeMBLfpqTp0IVB7Xipx6ekRQFUBjPacQc
GOOGLE_CLOUD_APIS=AIzaSyCeMBLfpqTp0IVB7Xipx6ekRQFUBjPacQc
SHOW_MATCH_VALUE=1

View File

@ -58,8 +58,8 @@ function searchHandler(dbConn) {
//response.data = searchResults
const cutScores = !(_.isEmpty(scoreQueryObj.climate) && _.isEmpty(scoreQueryObj.costs) && _.isEmpty(scoreQueryObj.others))
// TODO only dev:
searchResults.forEach(reg => reg.name = `${reg.name} (${_.round(reg.score * 10, 1)}% match)`)
// only dev:
if (process.env.SHOW_MATCH_VALUE === '1') searchResults.forEach(reg => reg.name = `${reg.name} (${_.round(reg.score * 10, 1)}% match)`)
// FILTER NULLSCORES
if (!_.get(q, 'showRegionsWithNullScore', false)) {