remove non-matches from input source arrays

This commit is contained in:
Jake McDermott 2019-03-19 20:21:37 -04:00
parent 4f13592430
commit 261a635005
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7

View File

@ -518,10 +518,12 @@ function AddEditCredentialsController (
const sourcesToDisassociate = fieldsToDisassociate
.map(name => vm.inputSources.initialItems
.find(({ input_field_name }) => input_field_name === name));
.find(({ input_field_name }) => input_field_name === name))
.filter(source => source !== undefined);
const sourcesToAssociate = fieldsToAssociate
.map(name => vm.inputSources.items
.find(({ input_field_name }) => input_field_name === name));
.find(({ input_field_name }) => input_field_name === name))
.filter(source => source !== undefined);
// remove inputs with empty string values
let filteredInputs = _.omit(data.inputs, (value) => value === '');