From d0796a3e09270a49e670d3410520953c620c3284 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 20 Jun 2018 12:58:46 +0200 Subject: [PATCH] Minor fixes in api responses --- pandora_console/include/functions_api.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index e3d58db881..1da5bbf5b1 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -11112,11 +11112,10 @@ function api_set_delete_cluster($id, $thrash1, $thrast2, $thrash3) { $tcluster_delete = db_process_sql('delete from tcluster where id = '.$id); $tcluster_agent_delete = agents_delete_agent($temp_id_cluster[0]['id_agent']); - if (!$tcluster_modules_delete || !$tcluster_items_delete || !$tcluster_agents_delete || !$tcluster_delete || !$tcluster_agent_delete) + if (($tcluster_modules_delete + $tcluster_items_delete + $tcluster_agents_delete + $tcluster_delete + $tcluster_agent_delete) == 0) returnError('error_delete', 'Error in delete operation.'); else - returnData('string', array('type' => 'string', 'data' => __('Correct Delete'))); - + returnData('string', array('type' => 'string', 'data' => __('Successfully deleted'))); } function api_set_delete_cluster_agents($thrash1, $thrast2, $other, $thrash3) { @@ -11430,7 +11429,7 @@ function api_get_agents_id_name_by_cluster_name($cluster_name, $trash1, $trash2, return; } - $all_agents = cluster_get_agents_id_name_by_cluster_id($cluster_name); + $all_agents = cluster_get_agents_id_name_by_cluster_id($value); if (count($all_agents) > 0 and $all_agents !== false) { $data = array('type' => 'json', 'data' => $all_agents);