Fix updatePrepaid.js user updates

This commit is contained in:
Scott Erickson 2016-07-22 09:33:44 -07:00
parent 1e0aa1a375
commit c3381c1274

View file

@ -60,7 +60,11 @@ var updatePrepaid = function updatePrepaid(stringID, originalUpdate) {
)
}
var userUpdate = _.pick(originalUpdate, 'startDate', 'endDate' );
var userUpdate = _(originalUpdate)
.pick('startDate', 'endDate' )
.transform(function(result, value, key) { result['coursePrepaid.'+key] = value })
.value();
if (_.isEmpty(userUpdate)) {
print('\nSkipping user update, nothing to update.')
}