Fixes bug removing first/last name from a user

This commit is contained in:
mabashian 2018-08-25 14:25:49 -04:00
parent b742746e5d
commit 4781df62ec

View File

@ -140,7 +140,11 @@ export default ['$scope', '$rootScope', '$stateParams', 'UserForm', 'Rest',
var processNewData = function(fields) {
var data = {};
_.forEach(fields, function(value, key) {
if ($scope[key] !== '' && $scope[key] !== null && $scope[key] !== undefined) {
if (value.type === 'sensitive') {
if ($scope[key] !== '' && $scope[key] !== null && $scope[key] !== undefined) {
data[key] = $scope[key];
}
} else {
data[key] = $scope[key];
}
});