mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Merge pull request #2745 from RnBConsulting/develop
Add user id and displayname in task status (API) v2
This commit is contained in:
commit
96d9b162c9
@ -45,7 +45,7 @@ class TaskApiController extends BaseAPIController
|
|||||||
{
|
{
|
||||||
$tasks = Task::scope()
|
$tasks = Task::scope()
|
||||||
->withTrashed()
|
->withTrashed()
|
||||||
->with('client', 'invoice', 'project', 'task_status')
|
->with('client', 'invoice', 'project', 'task_status', 'user')
|
||||||
->orderBy('updated_at', 'desc');
|
->orderBy('updated_at', 'desc');
|
||||||
|
|
||||||
return $this->listResponse($tasks);
|
return $this->listResponse($tasks);
|
||||||
|
@ -63,6 +63,8 @@ class TaskTransformer extends EntityTransformer
|
|||||||
{
|
{
|
||||||
return array_merge($this->getDefaults($task), [
|
return array_merge($this->getDefaults($task), [
|
||||||
'id' => (int) $task->public_id,
|
'id' => (int) $task->public_id,
|
||||||
|
'user_id' => (int) $task->user->public_id,
|
||||||
|
'user' => $task->user->getDisplayName(),
|
||||||
'description' => $task->description ?: '',
|
'description' => $task->description ?: '',
|
||||||
'duration' => $task->getDuration() ?: 0,
|
'duration' => $task->getDuration() ?: 0,
|
||||||
'updated_at' => (int) $this->getTimestamp($task->updated_at),
|
'updated_at' => (int) $this->getTimestamp($task->updated_at),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user