mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-19 14:17:54 +00:00
fix edit user roles on admin ui
This commit is contained in:
@@ -44,9 +44,9 @@ const EditUserModal: React.FC<EditUserModalProps> = ({ visible, possibleUIRoles,
|
||||
|
||||
const handleEditSubmit = async (formValues: Record<string, any>) => {
|
||||
// Call API to update team with teamId and values
|
||||
form.resetFields();
|
||||
|
||||
onSubmit(formValues);
|
||||
|
||||
form.resetFields();
|
||||
onCancel();
|
||||
};
|
||||
|
||||
@@ -95,15 +95,15 @@ const EditUserModal: React.FC<EditUserModalProps> = ({ visible, possibleUIRoles,
|
||||
name="user_role"
|
||||
>
|
||||
<Select2>
|
||||
{possibleUIRoles &&
|
||||
Object.entries(possibleUIRoles).map(([role, { ui_label, description }]) => (
|
||||
<SelectItem key={role} value={role} title={ui_label}>
|
||||
<div className='flex'>
|
||||
{ui_label} <p className="ml-2" style={{ color: "gray", fontSize: "12px" }}>{description}</p>
|
||||
</div>
|
||||
</SelectItem>
|
||||
))}
|
||||
</Select2>
|
||||
{possibleUIRoles &&
|
||||
Object.entries(possibleUIRoles).map(([role, { ui_label, description }]) => (
|
||||
<SelectItem key={role} value={role} title={ui_label}>
|
||||
<div className='flex'>
|
||||
{ui_label} <p className="ml-2" style={{ color: "gray", fontSize: "12px" }}>{description}</p>
|
||||
</div>
|
||||
</SelectItem>
|
||||
))}
|
||||
</Select2>
|
||||
|
||||
</Form.Item>
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ const ViewUserDashboard: React.FC<ViewUserDashboardProps> = ({
|
||||
return;
|
||||
}
|
||||
|
||||
userUpdateUserCall(accessToken, editedUser, userRole);
|
||||
userUpdateUserCall(accessToken, editedUser, null);
|
||||
|
||||
if (userData) {
|
||||
const updatedUserData = userData.map((user) =>
|
||||
|
||||
Reference in New Issue
Block a user