mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-12 14:45:42 +08:00
### What problem does this PR solve? Fix: When adding a chat in the main interface, a warning will automatically pop up (even if embedding and LLM model have already been configured). ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
31 lines
747 B
TypeScript
31 lines
747 B
TypeScript
import { IMemory } from '@/interfaces/database/memory';
|
|
import memoryService from '@/services/memory-service';
|
|
import { useQuery } from '@tanstack/react-query';
|
|
|
|
export const enum MemoryApiAction {
|
|
FetchMemoryList = 'fetchMemoryList',
|
|
}
|
|
|
|
export const useFetchAllMemoryList = () => {
|
|
const { data, isLoading, isError, refetch } = useQuery<IMemory[], Error>({
|
|
queryKey: [MemoryApiAction.FetchMemoryList],
|
|
queryFn: async () => {
|
|
const { data: response } = await memoryService.getMemoryList(
|
|
{
|
|
params: { page_size: 100, page: 1 },
|
|
data: {},
|
|
},
|
|
true,
|
|
);
|
|
return response.data.memory_list ?? [];
|
|
},
|
|
});
|
|
|
|
return {
|
|
data,
|
|
isLoading,
|
|
isError,
|
|
refetch,
|
|
};
|
|
};
|