Added possibility to track who did a habit (this implements and closes #21)

This commit is contained in:
Bernd Bestel
2018-07-24 20:45:14 +02:00
parent bcbdf58376
commit 249b01d7a8
16 changed files with 139 additions and 14 deletions

View File

@@ -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)