diff --git a/gui/pages/Content/Agents/AgentCreate.js b/gui/pages/Content/Agents/AgentCreate.js index 90aabea58..0de46038a 100644 --- a/gui/pages/Content/Agents/AgentCreate.js +++ b/gui/pages/Content/Agents/AgentCreate.js @@ -368,11 +368,11 @@ export default function AgentCreate({sendAgentData,selectedProjectId,fetchAgents return false; } - if (agentName.replace(/\s/g, '') === '') { + if (agentName?.replace(/\s/g, '') === '') { toast.error("Agent name can't be blank", {autoClose: 1800}); return false; } - if (agentDescription.replace(/\s/g, '') === '') { + if (agentDescription?.replace(/\s/g, '') === '') { toast.error("Agent description can't be blank", {autoClose: 1800}); return false; } diff --git a/gui/pages/api/DashboardService.js b/gui/pages/api/DashboardService.js index a5ae10c8b..f78c005da 100644 --- a/gui/pages/api/DashboardService.js +++ b/gui/pages/api/DashboardService.js @@ -57,7 +57,7 @@ export const updateExecution = (executionId, executionData) => { }; export const editAgentTemplate = (agentTemplateId, agentTemplateData) => { - return api.put(`/agent_templates/edit_agent_template/${agentTemplateId}`, agentTemplateData) + return api.put(`/agent_templates/update_agent_template/${agentTemplateId}`, agentTemplateData) } export const addExecution = (executionData) => {