Automation API #FIX
This commit is contained in:
@@ -7,15 +7,7 @@ class AutomationsApi extends ApiController
|
||||
{
|
||||
//$this->requireAuth();
|
||||
$response = [];
|
||||
$automationsData = AutomationManager::getAll();
|
||||
|
||||
foreach ($automationsData as $automationKey => $automation) {
|
||||
$response[] = [
|
||||
"automation_id" => $automation['automation_id'],
|
||||
"name" => $automation['name'],
|
||||
"enabled" => $automation['enabled'],
|
||||
];
|
||||
}
|
||||
$response = AutomationManager::getAll(["automation_id","name","enabled"]);
|
||||
|
||||
$this->response($response);
|
||||
}
|
||||
@@ -23,19 +15,9 @@ class AutomationsApi extends ApiController
|
||||
public function detail($automationId)
|
||||
{
|
||||
//$this->requireAuth();
|
||||
|
||||
$response = null;
|
||||
$automationData = AutomationManager::getById($automationId);
|
||||
|
||||
$response = [
|
||||
'automation_id' => $automationData['automation_id'],
|
||||
'last_execution_time' => $automationData['last_execution_time'],
|
||||
'owner' => $automationData['owner_id'],
|
||||
'conditions' => $automationData['conditions'],
|
||||
'tasks' => $automationData['tasks'],
|
||||
];
|
||||
$response = [];
|
||||
$response = AutomationManager::getById($automationId, ["automation_id", "last_execution_time", "owner_id", "conditions", "tasks"]);
|
||||
|
||||
$this->response($response);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user