diff --git a/query/address_search_using_ids.js b/query/address_search_using_ids.js index d7e2d1fd..a22cb917 100644 --- a/query/address_search_using_ids.js +++ b/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); } diff --git a/test/unit/query/address_search_using_ids.js b/test/unit/query/address_search_using_ids.js index 665aa681..27ecb85f 100644 --- a/test/unit/query/address_search_using_ids.js +++ b/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] });