From 3973a4cee5dd7d21c015eae4c823ce4b31c9d569 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Tue, 17 Mar 2015 13:57:50 +0900 Subject: [PATCH] Adding workaround for GetJSON screwing up profile dictionary. --- client/scripts/search.js | 4 +++- server/search.js | 13 +++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/client/scripts/search.js b/client/scripts/search.js index 072a27a..b92415d 100644 --- a/client/scripts/search.js +++ b/client/scripts/search.js @@ -149,7 +149,9 @@ } function getProfile() { - return JSON.parse(localStorage.profile || '{}'); + var profile = JSON.parse(localStorage.profile || '{}'); + profile.serial = true; + return profile; } window.onpopstate = function(state) { diff --git a/server/search.js b/server/search.js index 1e60d42..5d59195 100644 --- a/server/search.js +++ b/server/search.js @@ -191,6 +191,7 @@ function computeRecordGeo(records, context) { } function computeRecordCompat(records, context, callback) { + console.log(context.profile); async.map( records, function(record, callback) { @@ -231,7 +232,7 @@ function computeRecordCompat(records, context, callback) { }); }, function(err, results) { - console.log(results); + // console.log(results); callback(records); } ); @@ -255,11 +256,11 @@ function sanitizeQuery(query) { query.features = features; - for (var category in query.profile) { - if (parseFloat(query.profile[category]) === 0) { - delete query.profile[category]; - } - } + // for (var category in query.profile) { + // if (parseFloat(query.profile[category]) === 0) { + // delete query.profile[category]; + // } + // } } function getCategories(callback) {