Feat: Modify the data structure of the chunk in the conversation #3909 (#3955)

### What problem does this PR solve?

Feat: Modify the data structure of the chunk in the conversation #3909

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-12-10 16:36:16 +08:00
committed by GitHub
parent 03f00c9e6f
commit fc4e644e5f
27 changed files with 304 additions and 202 deletions

View File

@ -169,17 +169,34 @@ export const useFetchSystemStatus = () => {
};
};
export const useFetchSystemTokenList = (params: Record<string, any>) => {
export const useFetchManualSystemTokenList = () => {
const {
data,
isPending: loading,
mutateAsync,
} = useMutation({
mutationKey: ['fetchManualSystemTokenList'],
mutationFn: async () => {
const { data } = await userService.listToken();
return data?.data ?? [];
},
});
return { data, loading, fetchSystemTokenList: mutateAsync };
};
export const useFetchSystemTokenList = () => {
const {
data,
isFetching: loading,
refetch,
} = useQuery<IToken[]>({
queryKey: ['fetchSystemTokenList', params],
queryKey: ['fetchSystemTokenList'],
initialData: [],
gcTime: 0,
queryFn: async () => {
const { data } = await userService.listToken(params);
const { data } = await userService.listToken();
return data?.data ?? [];
},
@ -213,6 +230,7 @@ export const useRemoveSystemToken = () => {
export const useCreateSystemToken = () => {
const queryClient = useQueryClient();
const {
data,
isPending: loading,