mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? feat(search): Added app embedding functionality and optimized search page #3221 - Added an Embed App button and related functionality - Optimized the layout and interaction of the search settings interface - Adjusted the search result display method - Refactored some code to support new features ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -25,7 +25,7 @@ import { useDebounce } from 'ahooks';
|
||||
import { get, set } from 'lodash';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useParams } from 'umi';
|
||||
import { useParams, useSearchParams } from 'umi';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import {
|
||||
useGetPaginationWithRouter,
|
||||
@ -304,6 +304,9 @@ export const useSetAgent = (showMessage: boolean = true) => {
|
||||
// Only one file can be uploaded at a time
|
||||
export const useUploadCanvasFile = () => {
|
||||
const { id } = useParams();
|
||||
const [searchParams] = useSearchParams();
|
||||
const shared_id = searchParams.get('shared_id');
|
||||
const canvasId = id || shared_id;
|
||||
const {
|
||||
data,
|
||||
isPending: loading,
|
||||
@ -321,7 +324,7 @@ export const useUploadCanvasFile = () => {
|
||||
}
|
||||
|
||||
const { data } = await agentService.uploadCanvasFile(
|
||||
{ url: api.uploadAgentFile(id), data: nextBody },
|
||||
{ url: api.uploadAgentFile(canvasId as string), data: nextBody },
|
||||
true,
|
||||
);
|
||||
if (data?.code === 0) {
|
||||
|
||||
Reference in New Issue
Block a user