mirror of
https://github.com/grocy/grocy.git
synced 2025-10-02 21:36:08 +00:00
Also return the next_execution_assigned_user for the /chores API endpoint (closes #1493)
Include the user and category object for the /tasks API endpoint (closes #1494)
This commit is contained in:
@@ -140,7 +140,22 @@ class ChoresService extends BaseService
|
||||
|
||||
public function GetCurrent()
|
||||
{
|
||||
return $this->getDatabase()->chores_current();
|
||||
$users = $this->getUsersService()->GetUsersAsDto();
|
||||
|
||||
$chores = $this->getDatabase()->chores_current();
|
||||
foreach ($chores as $chore)
|
||||
{
|
||||
if (!empty($chore->next_execution_assigned_to_user_id))
|
||||
{
|
||||
$chore->next_execution_assigned_user = FindObjectInArrayByPropertyValue($users, 'id', $chore->next_execution_assigned_to_user_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$chore->next_execution_assigned_user = null;
|
||||
}
|
||||
}
|
||||
|
||||
return $chores;
|
||||
}
|
||||
|
||||
public function TrackChore(int $choreId, string $trackedTime, $doneBy = GROCY_USER_ID)
|
||||
|
Reference in New Issue
Block a user