Advertisement
aar6947

Untitled

Feb 12th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const { personRoles: { bunsinessModelId, function: functionId, role } } = person;
  2. const personRoleIndexToBeUpdated = person.personRoles.map((personRole, index) => {
  3.   if (personRole.businessModelId === bunsinessModelId
  4.     && personRole.fId === 1
  5.     && personRole.role === 2
  6.     && personRole.endDate === null) return index;
  7. }).filter(value => value !== undefined)[0];
  8.  
  9. person.personRoles[personRoleIndexToBeUpdated].status = personStatus.DRAFT;
  10. person.personRoles[personRoleIndexToBeUpdated].substatus = personSubstatus.PENDING_DATA;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement