Skip to content

Commit

Permalink
task: clear resource zuids to delete on api call success & do not do …
Browse files Browse the repository at this point in the history
…update granular role api call when no changes
  • Loading branch information
finnar-bin committed Oct 29, 2024
1 parent 8a45aa7 commit b92c83b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/components/accounts/roles/EditCustomRoleDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,12 @@ export const EditCustomRoleDialog = ({
if (!!roleData?.granularRoleZUID) {
// If a granularRoleZUID is already attached to the role, we can just
// do an update to add the new granular roles
return updateGranularRole({
roleZUID: ZUID,
granularRoles: payload,
});
if (!!payload?.length) {
return updateGranularRole({
roleZUID: ZUID,
granularRoles: payload,
});
}
} else {
// If the role doesn't have any granularRoleZUID attached, we need to create a
// granular role first
Expand Down Expand Up @@ -298,6 +300,7 @@ export const EditCustomRoleDialog = ({
getRoles(String(instanceZUID));
getPermissions(ZUID);
setIsSaving(false);
setResourceZUIDsToDelete([]);

// Navigate to the tab if that tab has errors
if (
Expand Down

0 comments on commit b92c83b

Please sign in to comment.