1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Fixes for Code Review

This commit is contained in:
Andreas Böhler 2019-03-21 16:46:46 +01:00
parent feb2f9ae82
commit afbd8df072
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -63,7 +63,7 @@ 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_id, 'user_id' => (int) $task->user->public_id,
'username' => $task->user->getDisplayName(), 'username' => $task->user->getDisplayName(),
'description' => $task->description ?: '', 'description' => $task->description ?: '',
'duration' => $task->getDuration() ?: 0, 'duration' => $task->getDuration() ?: 0,