-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed malfunction in user management regarding add user form #3173
Conversation
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Kudos, SonarCloud Quality Gate passed!
|
test approved |
if (userIndex <= USER_TYPES.indexOf("StateAdmin")) { | ||
setStates([ | ||
...initialStates, | ||
{ | ||
id: currentUser.data.state, | ||
name: currentUser.data.state_object.name, | ||
}, | ||
]); | ||
} else { | ||
setStates([...initialStates, ...statesRes.data.results]); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cp-Coder @gigincg wouldn't the condition always be true and hence the else block is never executed.
userIndex
is an index within USER_TYPES
, and StateAdmin is the last element in USER_TYPES
and hence it has the highest index. so...
Updates