From a6a97d264eccbfde0a350616c970878bbcb12669 Mon Sep 17 00:00:00 2001 From: marcos Date: Wed, 15 Jul 2020 23:41:25 +0200 Subject: [PATCH] changed event in progress method api refactored --- pandora_console/include/functions_api.php | 35 +++++++++-------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 28150d82aa..3013c186f1 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -16168,28 +16168,21 @@ function api_get_event_mcid($server_id, $console_event_id, $trash2, $returnType) function api_set_event_in_progress($event_id, $trash2, $returnType) { global $config; - if (is_metaconsole()) { - $event = db_process_sql_update( - 'tmetaconsole_event', - ['estado' => 2], - ['id_evento' => $event_id] - ); - if ($event !== false) { - returnData($returnType, ['type' => 'string', 'data' => $event]); - } else { - returnError('id_not_found', 'string'); - } + $table = 'tmetaconsole_event'; } else { - $event = db_process_sql_update( - 'tevento', - ['estado' => 2], - ['id_evento' => $event_id] - ); - if ($event !== false) { - returnData($returnType, ['type' => 'string', 'data' => $event]); - } else { - returnError('id_not_found', 'string'); - } + $table = 'tevento'; + } + + $event = db_process_sql_update( + $table, + ['estado' => 2], + ['id_evento' => $event_id] + ); + + if ($event !== false) { + returnData($returnType, ['type' => 'string', 'data' => $event]); + } else { + returnError('id_not_found', 'string'); } }