Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

515 B
Raw Blame
import { useDeleteFile } from '@/hooks/use-file-request';
import { useCallback } from 'react';
import { useGetFolderId } from './hooks';

export const useHandleDeleteFile = () => {
  const { deleteFile: removeDocument } = useDeleteFile();
  const parentId = useGetFolderId();

  const handleRemoveFile = useCallback(
    async (fileIds: string[]) => {
      const code = await removeDocument({ fileIds, parentId });

      return code;
    },
    [parentId, removeDocument],
  );

  return { handleRemoveFile };
};