mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 10:14:39 +00:00
Created API endpoints to undo battery charge cycles and chore executions (references #63)
This commit is contained in:
@@ -49,4 +49,17 @@ class BatteriesApiController extends BaseApiController
|
||||
{
|
||||
return $this->ApiResponse($this->BatteriesService->GetCurrent());
|
||||
}
|
||||
|
||||
public function UndoChargeCycle(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->ApiResponse($this->BatteriesService->UndoChargeCycle($args['chargeCycleId']));
|
||||
return $this->ApiResponse(array('success' => true));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->VoidApiActionResponse($response, false, 400, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user