mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: race condition when adding users
This commit is contained in:
parent
2c559af3a6
commit
c54ea3a9d4
@ -51,9 +51,11 @@ function AddUserComponent({ roles, addUserToRole }) {
|
||||
setSelect(false);
|
||||
};
|
||||
|
||||
const handleSelectUser = (evt, value) => {
|
||||
const handleSelectUser = (evt, selectedUser) => {
|
||||
setOptions([]);
|
||||
setUser(value);
|
||||
if(selectedUser.id) {
|
||||
setUser(selectedUser);
|
||||
}
|
||||
};
|
||||
|
||||
const handleRoleChange = evt => {
|
||||
@ -63,6 +65,7 @@ function AddUserComponent({ roles, addUserToRole }) {
|
||||
};
|
||||
|
||||
const handleSubmit = async evt => {
|
||||
debugger;
|
||||
evt.preventDefault();
|
||||
await addUserToRole(user.id, role.id);
|
||||
setUser(undefined);
|
||||
|
Loading…
Reference in New Issue
Block a user