1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Add user /assigned user to task transformer

This commit is contained in:
David Bomba 2024-03-22 14:45:01 +11:00
parent e8f9577bb8
commit 5197a04d31

View File

@ -42,6 +42,7 @@ class TaskTransformer extends EntityTransformer
'project',
'user',
'invoice',
'assigned_user',
];
public function includeDocuments(Task $task)
@ -73,6 +74,16 @@ class TaskTransformer extends EntityTransformer
return $this->includeItem($task->user, $transformer, User::class);
}
public function includeAssignedUser(Task $task): ?Item
{
$transformer = new UserTransformer($this->serializer);
if (!$task->assigned_user) {
return null;
}
return $this->includeItem($task->assigned_user, $transformer, User::class);
}
public function includeClient(Task $task): ?Item
{