Allow for some tags (takeaway) to be kept thru a NSI upgrade

(closes #6530, closes #6581)
This commit is contained in:
Bryan Housel
2019-06-30 01:42:43 -04:00
parent 2307125842
commit ca2c6b1098

View File

@@ -102,8 +102,16 @@ export function validationOutdatedTags(context) {
var brand = brands.brands[match.kvnd];
if (brand && brand.tags['brand:wikidata']) {
subtype = 'noncanonical_brand';
nsiKeys.forEach(function(remove) { delete newTags[remove]; });
Object.assign(newTags, brand.tags);
var keepTags = ['takeaway'].reduce(function(acc, k) {
if (newTags[k]) {
acc[k] = newTags[k];
}
return acc;
}, {});
nsiKeys.forEach(function(k) { delete newTags[k]; });
Object.assign(newTags, brand.tags, keepTags);
break;
}
}