#12139 Fix new_agent api request

This commit is contained in:
miguel angel rasteu 2023-09-27 15:47:44 +02:00
parent 5fc3ed3338
commit 5d41cf7d04
1 changed files with 2 additions and 2 deletions

View File

@ -2014,7 +2014,7 @@ function api_set_new_agent($id_node, $thrash2, $other, $trhash3, $return=false,
}
returnError('No agent alias specified');
} else if (agents_get_agent_id($nombre_agente)) {
} else if (agents_get_agent_id($agent->nombre())) {
if ($message === true) {
return 'The agent name already exists in DB.';
}
@ -2062,7 +2062,7 @@ function api_set_new_agent($id_node, $thrash2, $other, $trhash3, $return=false,
}
}
if ($return === false) {
if ($return !== true) {
returnData(
'string',
[