mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-11 22:09:44 +00:00
feat: spaceId change to spaceName
This commit is contained in:
@@ -5,8 +5,8 @@ import { SearchDocumentParams } from '@/types/knowledge';
|
||||
/**
|
||||
* 知识库编辑搜索
|
||||
*/
|
||||
export const searchDocumentList = (id: string, data: SearchDocumentParams) => {
|
||||
return POST<SearchDocumentParams, { data: string[]; total: number; page: number }>(`/knowledge/${id}/document/list`, data);
|
||||
export const searchDocumentList = (spaceName: string, data: SearchDocumentParams) => {
|
||||
return POST<SearchDocumentParams, { data: string[]; total: number; page: number }>(`/knowledge/${spaceName}/document/list`, data);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -164,7 +164,7 @@ export const saveArguments = (knowledgeName: string, data: ArgumentsParams) => {
|
||||
export const getSpaceList = (data: any) => {
|
||||
return POST<any, Array<ISpace>>('/knowledge/space/list', data);
|
||||
};
|
||||
export const getDocumentList = (spaceName: number, data: Record<string, number | Array<number>>) => {
|
||||
export const getDocumentList = (spaceName: string, data: Record<string, number | Array<number>>) => {
|
||||
return POST<Record<string, number | Array<number>>, IDocumentResponse>(`/knowledge/${spaceName}/document/list`, data);
|
||||
};
|
||||
export const getGraphVis = (spaceName: string, data: { limit: number }) => {
|
||||
|
@@ -21,7 +21,7 @@ const RecallTestModal: React.FC<RecallTestModalProps> = ({ open, setOpen, space
|
||||
// 获取推荐问题
|
||||
const { data: questions = [], run: questionsRun } = useRequest(
|
||||
async () => {
|
||||
const [, res] = await apiInterceptors(recallTestRecommendQuestion(space.id + ''));
|
||||
const [, res] = await apiInterceptors(recallTestRecommendQuestion(space.name + ''));
|
||||
return res ?? [];
|
||||
},
|
||||
{
|
||||
@@ -32,7 +32,7 @@ const RecallTestModal: React.FC<RecallTestModalProps> = ({ open, setOpen, space
|
||||
// 召回方法选项
|
||||
const { data: options = [], run: optionsRun } = useRequest(
|
||||
async () => {
|
||||
const [, res] = await apiInterceptors(recallMethodOptions(space.id + ''));
|
||||
const [, res] = await apiInterceptors(recallMethodOptions(space.name + ''));
|
||||
return res ?? [];
|
||||
},
|
||||
{
|
||||
@@ -57,7 +57,7 @@ const RecallTestModal: React.FC<RecallTestModalProps> = ({ open, setOpen, space
|
||||
loading,
|
||||
} = useRequest(
|
||||
async (props: RecallTestProps) => {
|
||||
const [, res] = await apiInterceptors(recallTest({ ...props }, space.id + ''));
|
||||
const [, res] = await apiInterceptors(recallTest({ ...props }, space.name + ''));
|
||||
return res ?? [];
|
||||
},
|
||||
{
|
||||
|
@@ -20,7 +20,7 @@ export default function ArgumentsModal({ space, argumentsShow, setArgumentsShow
|
||||
const [spinning, setSpinning] = useState<boolean>(false);
|
||||
|
||||
const fetchArguments = async () => {
|
||||
const [_, data] = await apiInterceptors(getArguments(space.id));
|
||||
const [_, data] = await apiInterceptors(getArguments(space.name));
|
||||
setNewSpaceArguments(data);
|
||||
};
|
||||
|
||||
@@ -145,7 +145,7 @@ export default function ArgumentsModal({ space, argumentsShow, setArgumentsShow
|
||||
const handleSubmit = async (fieldsValue: IArguments) => {
|
||||
setSpinning(true);
|
||||
const [_, data, res] = await apiInterceptors(
|
||||
saveArguments(space.id, {
|
||||
saveArguments(space.name, {
|
||||
argument: JSON.stringify(fieldsValue),
|
||||
}),
|
||||
);
|
||||
|
@@ -117,7 +117,7 @@ export default function DocPanel(props: IProps) {
|
||||
} = useRequest(
|
||||
async () =>
|
||||
await apiInterceptors(
|
||||
getDocumentList(+space.id, {
|
||||
getDocumentList(space.name, {
|
||||
page: currentPageRef.current,
|
||||
page_size,
|
||||
}),
|
||||
@@ -139,7 +139,7 @@ export default function DocPanel(props: IProps) {
|
||||
}
|
||||
currentPageRef.current += 1;
|
||||
const [_, data] = await apiInterceptors(
|
||||
getDocumentList(+space.id, {
|
||||
getDocumentList(space.name, {
|
||||
page: currentPageRef.current,
|
||||
page_size,
|
||||
}),
|
||||
|
Reference in New Issue
Block a user