mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? feat: Select derived messages from backend #2088 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -2,8 +2,11 @@ import { ResponseType } from '@/interfaces/database/base';
|
||||
import { DSL, IFlow, IFlowTemplate } from '@/interfaces/database/flow';
|
||||
import i18n from '@/locales/config';
|
||||
import flowService from '@/services/flow-service';
|
||||
import { buildMessageListWithUuid } from '@/utils/chat';
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { message } from 'antd';
|
||||
import { set } from 'lodash';
|
||||
import get from 'lodash/get';
|
||||
import { useParams } from 'umi';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
|
||||
@ -101,6 +104,11 @@ export const useFetchFlow = (): {
|
||||
queryFn: async () => {
|
||||
const { data } = await flowService.getCanvas({}, id);
|
||||
|
||||
const messageList = buildMessageListWithUuid(
|
||||
get(data, 'data.dsl.messages', []),
|
||||
);
|
||||
set(data, 'data.dsl.messages', messageList);
|
||||
|
||||
return data?.data ?? {};
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user