changed event in progress method api refactored

This commit is contained in:
marcos 2020-07-15 23:41:25 +02:00
parent 9632b36551
commit a6a97d264e

View File

@ -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) function api_set_event_in_progress($event_id, $trash2, $returnType)
{ {
global $config; global $config;
if (is_metaconsole()) { if (is_metaconsole()) {
$event = db_process_sql_update( $table = 'tmetaconsole_event';
'tmetaconsole_event',
['estado' => 2],
['id_evento' => $event_id]
);
if ($event !== false) {
returnData($returnType, ['type' => 'string', 'data' => $event]);
} else {
returnError('id_not_found', 'string');
}
} else { } else {
$event = db_process_sql_update( $table = 'tevento';
'tevento', }
['estado' => 2],
['id_evento' => $event_id] $event = db_process_sql_update(
); $table,
if ($event !== false) { ['estado' => 2],
returnData($returnType, ['type' => 'string', 'data' => $event]); ['id_evento' => $event_id]
} else { );
returnError('id_not_found', 'string');
} if ($event !== false) {
returnData($returnType, ['type' => 'string', 'data' => $event]);
} else {
returnError('id_not_found', 'string');
} }
} }