quickfix for inverted logic
This commit is contained in:
parent
e54232842b
commit
c602e75f33
@ -54,7 +54,7 @@ function searchHandler(dbConn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FILTER NULLSCORES
|
// FILTER NULLSCORES
|
||||||
if (_.get(q, 'showRegionsWithNullScore', false)) {
|
if (!_.get(q, 'showRegionsWithNullScore', false)) {
|
||||||
console.log('without null scores');
|
console.log('without null scores');
|
||||||
response = response.filter(el => !_.some(el.scores, score => _.isNaN(score.score) || _.isNull(score.score) || _.isUndefined(score.score)))//.filter(el => !_.isNaN(el.score))
|
response = response.filter(el => !_.some(el.scores, score => _.isNaN(score.score) || _.isNull(score.score) || _.isUndefined(score.score)))//.filter(el => !_.isNaN(el.score))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,29 +102,6 @@ module.exports = function (dbConn) {
|
|||||||
return _.round(sum / cnt, 2)
|
return _.round(sum / cnt, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepareQueries(queries) {
|
|
||||||
let q = {
|
|
||||||
climate: {},
|
|
||||||
costs: {}
|
|
||||||
}
|
|
||||||
// climate
|
|
||||||
if (queries.temperature_mean_max) q.climate.temperature_mean_max = queries.temperature_mean_max
|
|
||||||
if (queries.precipitation) q.climate.precipitation = queries.precipitation
|
|
||||||
if (queries.rain_days) q.climate.rain_days = queries.rain_days
|
|
||||||
if (queries.sun_hours) q.climate.sun_hours = queries.sun_hours
|
|
||||||
|
|
||||||
// costs
|
|
||||||
if (queries.accommodation_costs) q.costs.accommodation_costs = queries.accommodation_costs
|
|
||||||
if (queries.food_costs) q.costs.food_costs = queries.food_costs
|
|
||||||
if (queries.alcohol_costs) q.costs.alcohol_costs = queries.alcohol_costs
|
|
||||||
if (queries.water_costs) q.costs.water_costs = queries.water_costs
|
|
||||||
if (queries.local_transportation_costs) q.costs.local_transportation_costs = queries.local_transportation_costs
|
|
||||||
if (queries.entertainment_costs) q.costs.entertainment_costs = queries.entertainment_costs
|
|
||||||
if (queries.average_per_day_costs) q.costs.average_per_day_costs = queries.average_per_day_costs
|
|
||||||
|
|
||||||
return q
|
|
||||||
}
|
|
||||||
|
|
||||||
function travelPeriodsFromDates(dates) {
|
function travelPeriodsFromDates(dates) {
|
||||||
//console.log(dates);
|
//console.log(dates);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user