fix save file attributes

This commit is contained in:
Dan Percic 2021-11-17 17:02:42 +02:00
parent 7539b2a0f7
commit f500f0fd5a

View File

@ -157,7 +157,7 @@ export class FileAttributesCsvImportDialogComponent extends ListingComponent<IFi
async save() {
const newPrimary = !!this.activeFields.find(attr => attr.primaryAttribute);
let fileAttributeConfigs = this.data.existingConfiguration.fileAttributeConfigs;
let fileAttributeConfigs = this.data.existingConfiguration.fileAttributeConfigs ?? [];
if (newPrimary) {
fileAttributeConfigs = fileAttributeConfigs.map(attr => new FileAttributeConfig({ ...attr, primaryAttribute: false }));
}