Cleanup profile to exclude empty items
This commit is contained in:
parent
86deb64108
commit
c5fc9ea80b
@ -202,10 +202,16 @@ function sanitizeQuery(query) {
|
|||||||
|
|
||||||
var features = {};
|
var features = {};
|
||||||
_.each(keys, function(key) {
|
_.each(keys, function(key) {
|
||||||
features[key] = _.has(query.features, key) ? query.features[key] : 0.0;
|
features[key] = _.has(query.features, key) ? query.features[key] : 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
query.features = features;
|
query.features = features;
|
||||||
|
|
||||||
|
for (var category in query.profile) {
|
||||||
|
if (parseFloat(query.profile[category]) === 0) {
|
||||||
|
delete query.profile[category];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCategories(callback) {
|
function getCategories(callback) {
|
||||||
|
Loading…
Reference in New Issue
Block a user