fix: chat stream data too long
This commit is contained in:
@@ -29,3 +29,13 @@ export async function deleteUser(id: number) {
|
||||
method: 'DELETE'
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateUserStatus(params: {
|
||||
id: number;
|
||||
data: { is_active: boolean };
|
||||
}) {
|
||||
return request(`${USERS_API}/${params.id}/activation`, {
|
||||
method: 'PATCH',
|
||||
data: params.data
|
||||
});
|
||||
}
|
||||
|
||||
@@ -23,6 +23,16 @@ const actionList: Global.ActionItem[] = [
|
||||
key: 'edit',
|
||||
icon: icons.EditOutlined
|
||||
},
|
||||
{
|
||||
label: 'Active Account',
|
||||
key: 'active',
|
||||
icon: icons.EditOutlined
|
||||
},
|
||||
{
|
||||
label: 'Deactivate Account',
|
||||
key: 'inactive',
|
||||
icon: icons.EditOutlined
|
||||
},
|
||||
{
|
||||
label: 'common.button.delete',
|
||||
key: 'delete',
|
||||
@@ -40,8 +50,14 @@ const useUsersColumns = ({
|
||||
|
||||
const setActions = useMemoizedFn((record: ListItem) => {
|
||||
return actionList.filter((action) => {
|
||||
if (initialState?.currentUser?.id === record.id) {
|
||||
return action.key !== 'delete';
|
||||
if (action.key === 'delete') {
|
||||
return initialState?.currentUser?.id !== record.id;
|
||||
}
|
||||
if (action.key === 'active') {
|
||||
return !record.is_active && initialState?.currentUser?.id !== record.id;
|
||||
}
|
||||
if (action.key === 'inactive') {
|
||||
return record.is_active && initialState?.currentUser?.id !== record.id;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user