Browse Source

Use flat clean structure in query/autocomplete.js

pull/271/head
Julian Simioni 9 years ago
parent
commit
dd9654657e
  1. 6
      query/autocomplete.js
  2. 4
      test/unit/query/autocomplete.js

6
query/autocomplete.js

@ -31,10 +31,10 @@ function generateQuery( clean ){
vs.var( 'size', 10 );
// focus point
if( clean.lat && clean.lon ){
if( clean['focus.point.lat'] && clean['focus.point.lon'] ){
vs.set({
'focus:point:lat': clean.lat,
'focus:point:lon': clean.lon
'focus:point:lat': clean['focus.point.lat'],
'focus:point:lon': clean['focus.point.lon']
});
}

4
test/unit/query/autocomplete.js

@ -27,8 +27,8 @@ module.exports.tests.query = function(test, common) {
test('autocomplete + focus', function(t) {
var query = generate({
text: 'test',
lat: 29.49136,
lon: -82.50622
'focus.point.lat': 29.49136,
'focus.point.lon': -82.50622
});
var compiled = JSON.parse( JSON.stringify( query ) );

Loading…
Cancel
Save