Browse Source

don't serialize input:layers when passing to query

pull/912/head
Stephen Hess 8 years ago
parent
commit
447d0f74b9
  1. 2
      query/address_search_using_ids.js
  2. 6
      test/unit/query/address_search_using_ids.js

2
query/address_search_using_ids.js

@ -131,7 +131,7 @@ function generateQuery( clean, res ){
// use an object here instead of calling `set` since that flattens out an
// object into key/value pairs and makes identifying layers harder in query module
vs.var('input:layers', JSON.stringify(layers_to_ids));
vs.var('input:layers', layers_to_ids);
}

6
test/unit/query/address_search_using_ids.js

@ -251,7 +251,7 @@ module.exports.tests.granularity_bands = (test, common) => {
const generatedQuery = generateQuery(clean, res);
t.deepEquals(JSON.parse(generatedQuery.body.vs.var('input:layers')), {
t.deepEquals(generatedQuery.body.vs.var('input:layers').$, {
neighbourhood: [1, 11],
borough: [2, 12],
locality: [3, 13],
@ -296,7 +296,7 @@ module.exports.tests.granularity_bands = (test, common) => {
const generatedQuery = generateQuery(clean, res);
t.deepEquals(JSON.parse(generatedQuery.body.vs.var('input:layers')), {
t.deepEquals(generatedQuery.body.vs.var('input:layers').$, {
neighbourhood: [1],
borough: [],
locality: [],
@ -354,7 +354,7 @@ module.exports.tests.granularity_bands = (test, common) => {
const generatedQuery = generateQuery(clean, res);
t.deepEquals(JSON.parse(generatedQuery.body.vs.var('input:layers')), {
t.deepEquals(generatedQuery.body.vs.var('input:layers').$, {
county: [1, 4],
macrocounty: [2, 5]
});

Loading…
Cancel
Save