mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-19 06:01:05 +08:00
Feat: Added support for session graph and session essence templates. (#16851)
### Summary Feat: Added support for session graph and session essence templates.
This commit is contained in:
@@ -20,7 +20,7 @@ export interface IChunkListResult {
|
||||
searchString?: string;
|
||||
handleInputChange?: React.ChangeEventHandler<HTMLInputElement>;
|
||||
pagination: PaginationProps;
|
||||
setPagination?: (pagination: { page: number; pageSize: number }) => void;
|
||||
setPagination?: (pagination: { page: number; pageSize?: number }) => void;
|
||||
available: number | undefined;
|
||||
handleSetAvailable: (available: number | undefined) => void;
|
||||
dataUpdatedAt?: number; // Timestamp when data was last updated - useful for cache busting
|
||||
|
||||
@@ -12,9 +12,11 @@ import {
|
||||
getCompilationTemplateGroup,
|
||||
updateCompilationTemplateGroup,
|
||||
} from '@/services/compilation-template-group-service';
|
||||
import { isCreateCompilationTemplateGroup } from '@/utils/compilation-template-util';
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { useDebounce } from 'ahooks';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { useParams } from 'react-router';
|
||||
|
||||
import {
|
||||
useGetPaginationWithRouter,
|
||||
@@ -98,15 +100,18 @@ export const useFetchCompilationTemplateGroupsByPage = () => {
|
||||
};
|
||||
};
|
||||
|
||||
export const useFetchCompilationTemplateGroup = (id?: string) => {
|
||||
export const useFetchCompilationTemplateGroup = () => {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const isCreate = isCreateCompilationTemplateGroup(id);
|
||||
|
||||
const { data, isFetching: loading } = useQuery<
|
||||
ICompilationTemplateGroup | undefined
|
||||
>({
|
||||
queryKey: CompilationTemplateGroupKeys.detail(id),
|
||||
enabled: !!id && id !== 'create',
|
||||
enabled: !isCreate,
|
||||
gcTime: 0,
|
||||
queryFn: async () => {
|
||||
if (!id || id === 'create') return undefined;
|
||||
if (isCreate) return undefined;
|
||||
const { data } = await getCompilationTemplateGroup(id);
|
||||
return data?.data as ICompilationTemplateGroup | undefined;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user