mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 11:06:36 +00:00
Added possibility to track who did a habit (this implements and closes #21)
This commit is contained in:
@@ -22,9 +22,15 @@ class HabitsApiController extends BaseApiController
|
||||
$trackedTime = $request->getQueryParams()['tracked_time'];
|
||||
}
|
||||
|
||||
$doneBy = GROCY_USER_ID;
|
||||
if (isset($request->getQueryParams()['done_by']) && !empty($request->getQueryParams()['done_by']))
|
||||
{
|
||||
$doneBy = $request->getQueryParams()['done_by'];
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$this->HabitsService->TrackHabit($args['habitId'], $trackedTime);
|
||||
$this->HabitsService->TrackHabit($args['habitId'], $trackedTime, $doneBy);
|
||||
return $this->VoidApiActionResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
|
Reference in New Issue
Block a user