Merge pull request #1290 from williamhliu/master

(fix)(supersonic-fe) fix add agent error
This commit is contained in:
williamhliu
2024-06-30 09:42:26 +08:00
committed by GitHub
2 changed files with 9 additions and 2 deletions

View File

@@ -277,7 +277,7 @@ const AgentForm: React.FC<Props> = ({ editAgent, onSaveAgent, onCreateToolBtnCli
{
label: '记忆管理',
key: 'memory',
children: <MemorySection agentId={editAgent!.id!} />,
children: <MemorySection agentId={editAgent?.id} />,
},
];

View File

@@ -10,7 +10,7 @@ const { TextArea, Search } = Input;
const RadioGroup = Radio.Group;
type Props = {
agentId: number;
agentId?: number;
};
const MemorySection = ({ agentId }: Props) => {
@@ -166,6 +166,13 @@ const MemorySection = ({ agentId }: Props) => {
filtersValue,
current,
}: { filtersValue?: any; current?: number } = {}) => {
if (!agentId) {
return {
data: [],
total: 0,
success: true,
};
}
setLoading(true);
const res = await getMemeoryList(agentId, filtersValue || filters, current || 1);
setLoading(false);