Skip to content

Commit

Permalink
Merge pull request #1077 from Crown-Commercial-Service/p3sprint4
Browse files Browse the repository at this point in the history
Multiple approval role save button not working (#1076)
  • Loading branch information
ponselvamsakthivel-bc authored Jan 30, 2023
2 parents 9624865 + ccfe95b commit a7a0090
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,10 @@ export class ManageUserAddSingleUserDetailComponent
}

private invalidDomainConfig(role: any) {
let filterRole = this.approveRequiredRole.find((element: { roleKey: any; }) => element.roleKey == role.roleKey)
if (filterRole === undefined) {
let filterRole = this.approveRequiredRole.find((element: { roleKey: any; }) => element.roleKey == role.roleKey);
let roleAlredyApprovedAndAssigned = this.userProfileResponseInfo?.detail?.rolePermissionInfo?.find(x => x.roleKey == role.roleKey);

if (filterRole === undefined || (filterRole && roleAlredyApprovedAndAssigned)) {
this.selectedRoleIds.push(role.roleId)
} else {
this.pendingRolecheck(role)
Expand All @@ -487,8 +489,9 @@ export class ManageUserAddSingleUserDetailComponent
}

private whenPendingRoleHavingLength(role: any) {
let filterAlreadyExistRole = this.pendingRoleDetails.find((element: { roleKey: any; }) => element.roleKey == role.roleKey)
if (filterAlreadyExistRole.roleKey != role.roleKey) {
let filterAlreadyExistRole = this.pendingRoleDetails.find((element: { roleKey: any; }) => element.roleKey == role.roleKey);

if (!filterAlreadyExistRole) {
this.selectedApproveRequiredRole.push(role.roleId)
}
}
Expand Down

0 comments on commit a7a0090

Please sign in to comment.