Advertisement
aar6947

Untitled

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