Feat: Add memory multi-select dropdown to recall and message operator forms. #4213 (#12106)

### What problem does this PR solve?

Feat: Add memory multi-select dropdown to recall and message operator
forms. #4213

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-12-23 11:54:32 +08:00
committed by GitHub
parent 712d537d66
commit 9e31631d8f
10 changed files with 95 additions and 13 deletions

View File

@ -0,0 +1,30 @@
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: 100000000, page: 1 },
data: {},
},
true,
);
return response.data.memory_list ?? [];
},
});
return {
data,
isLoading,
isError,
refetch,
};
};