mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-15 14:15:55 +08:00
### What problem does this PR solve? feat: Catch errors in getting mindmap #2247 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
f789098e9f
commit
8e3228d461
@ -16,7 +16,7 @@ import { buildMessageListWithUuid, isConversationIdExist } from '@/utils/chat';
|
|||||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import dayjs, { Dayjs } from 'dayjs';
|
import dayjs, { Dayjs } from 'dayjs';
|
||||||
import { set } from 'lodash';
|
import { has, set } from 'lodash';
|
||||||
import { useCallback, useMemo, useState } from 'react';
|
import { useCallback, useMemo, useState } from 'react';
|
||||||
import { useSearchParams } from 'umi';
|
import { useSearchParams } from 'umi';
|
||||||
|
|
||||||
@ -492,9 +492,16 @@ export const useFetchMindMap = () => {
|
|||||||
mutationKey: ['fetchMindMap'],
|
mutationKey: ['fetchMindMap'],
|
||||||
gcTime: 0,
|
gcTime: 0,
|
||||||
mutationFn: async (params: IAskRequestBody) => {
|
mutationFn: async (params: IAskRequestBody) => {
|
||||||
const { data } = await chatService.getMindMap(params);
|
try {
|
||||||
|
const ret = await chatService.getMindMap(params);
|
||||||
|
return ret?.data?.data ?? [];
|
||||||
|
} catch (error) {
|
||||||
|
if (has(error, 'message')) {
|
||||||
|
message.error(error.message);
|
||||||
|
}
|
||||||
|
|
||||||
return data?.data ?? [];
|
return [];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user