Browse Source

removed unneeded conditional for abbreviation set

pull/899/head
Stephen Hess 8 years ago
parent
commit
d67830ca48
  1. 7
      controller/coarse_reverse.js
  2. 3
      test/unit/controller/coarse_reverse.js

7
controller/coarse_reverse.js

@ -83,12 +83,7 @@ function synthesizeDoc(results) {
// assign the administrative hierarchy // assign the administrative hierarchy
Object.keys(results).forEach((layer) => { Object.keys(results).forEach((layer) => {
if (results[layer][0].hasOwnProperty('abbr')) { doc.addParent(layer, results[layer][0].name, results[layer][0].id.toString(), results[layer][0].abbr);
doc.addParent(layer, results[layer][0].name, results[layer][0].id.toString(), results[layer][0].abbr);
} else {
doc.addParent(layer, results[layer][0].name, results[layer][0].id.toString());
}
}); });
const esDoc = doc.toESDocument(); const esDoc = doc.toESDocument();

3
test/unit/controller/coarse_reverse.js

@ -237,7 +237,6 @@ module.exports.tests.success_conditions = (test, common) => {
{ {
id: 10, id: 10,
name: 'neighbourhood name', name: 'neighbourhood name',
abbr: 'neighbourhood abbr',
centroid: { centroid: {
lat: 12.121212, lat: 12.121212,
lon: 21.212121 lon: 21.212121
@ -291,7 +290,7 @@ module.exports.tests.success_conditions = (test, common) => {
parent: { parent: {
neighbourhood: ['neighbourhood name'], neighbourhood: ['neighbourhood name'],
neighbourhood_id: ['10'], neighbourhood_id: ['10'],
neighbourhood_a: ['neighbourhood abbr'] neighbourhood_a: [null]
}, },
center_point: { center_point: {
lat: 12.121212, lat: 12.121212,

Loading…
Cancel
Save