fix: chat stream data too long

This commit is contained in:
jialin
2025-11-06 15:37:42 +08:00
parent 38cc179068
commit e1e38f0404
7 changed files with 68 additions and 39 deletions
+10
View File
@@ -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
});
}
+18 -2
View File
@@ -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;
});