mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 20:25:12 +00:00
(fix)(supersonic-fe) fix add agent error
This commit is contained in:
@@ -277,7 +277,7 @@ const AgentForm: React.FC<Props> = ({ editAgent, onSaveAgent, onCreateToolBtnCli
|
|||||||
{
|
{
|
||||||
label: '记忆管理',
|
label: '记忆管理',
|
||||||
key: 'memory',
|
key: 'memory',
|
||||||
children: <MemorySection agentId={editAgent!.id!} />,
|
children: <MemorySection agentId={editAgent?.id} />,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const { TextArea, Search } = Input;
|
|||||||
const RadioGroup = Radio.Group;
|
const RadioGroup = Radio.Group;
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
agentId: number;
|
agentId?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
const MemorySection = ({ agentId }: Props) => {
|
const MemorySection = ({ agentId }: Props) => {
|
||||||
@@ -166,6 +166,13 @@ const MemorySection = ({ agentId }: Props) => {
|
|||||||
filtersValue,
|
filtersValue,
|
||||||
current,
|
current,
|
||||||
}: { filtersValue?: any; current?: number } = {}) => {
|
}: { filtersValue?: any; current?: number } = {}) => {
|
||||||
|
if (!agentId) {
|
||||||
|
return {
|
||||||
|
data: [],
|
||||||
|
total: 0,
|
||||||
|
success: true,
|
||||||
|
};
|
||||||
|
}
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const res = await getMemeoryList(agentId, filtersValue || filters, current || 1);
|
const res = await getMemeoryList(agentId, filtersValue || filters, current || 1);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user