Added conditional pushing or replacing of fields inside fieldsName, based on this.shouldOverwrite

This commit is contained in:
alexandercerutti
2018-08-26 12:06:21 +02:00
parent 04b5058f3a
commit 4e3fa748c1

View File

@@ -526,8 +526,12 @@ class Pass {
fieldsName.forEach(area => { fieldsName.forEach(area => {
if (this[area].fields.length) { if (this[area].fields.length) {
if (this.shouldOverwrite) {
passFile[this.type][area] = this[area].fields;
} else {
passFile[this.type][area].push(...this[area].fields); passFile[this.type][area].push(...this[area].fields);
} }
}
}); });
if (this.type === "boardingPass" && this.transitType) { if (this.type === "boardingPass" && this.transitType) {