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);
|
setSelect(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSelectUser = (evt, value) => {
|
const handleSelectUser = (evt, selectedUser) => {
|
||||||
setOptions([]);
|
setOptions([]);
|
||||||
setUser(value);
|
if(selectedUser.id) {
|
||||||
|
setUser(selectedUser);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRoleChange = evt => {
|
const handleRoleChange = evt => {
|
||||||
@ -63,6 +65,7 @@ function AddUserComponent({ roles, addUserToRole }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSubmit = async evt => {
|
const handleSubmit = async evt => {
|
||||||
|
debugger;
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
await addUserToRole(user.id, role.id);
|
await addUserToRole(user.id, role.id);
|
||||||
setUser(undefined);
|
setUser(undefined);
|
||||||
|
Loading…
Reference in New Issue
Block a user