From afbd8df0728f2a84dbfb85067213eb8d061e2173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20B=C3=B6hler?= Date: Thu, 21 Mar 2019 16:46:46 +0100 Subject: [PATCH] Fixes for Code Review --- app/Http/Controllers/TaskApiController.php | 2 +- app/Ninja/Transformers/TaskTransformer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/TaskApiController.php b/app/Http/Controllers/TaskApiController.php index cead941fd9..c5d2682b14 100644 --- a/app/Http/Controllers/TaskApiController.php +++ b/app/Http/Controllers/TaskApiController.php @@ -45,7 +45,7 @@ class TaskApiController extends BaseAPIController { $tasks = Task::scope() ->withTrashed() - ->with('client', 'invoice', 'project', 'task_status') + ->with('client', 'invoice', 'project', 'task_status', 'user') ->orderBy('updated_at', 'desc'); return $this->listResponse($tasks); diff --git a/app/Ninja/Transformers/TaskTransformer.php b/app/Ninja/Transformers/TaskTransformer.php index 20989b816c..45d5907b61 100644 --- a/app/Ninja/Transformers/TaskTransformer.php +++ b/app/Ninja/Transformers/TaskTransformer.php @@ -63,7 +63,7 @@ class TaskTransformer extends EntityTransformer { return array_merge($this->getDefaults($task), [ 'id' => (int) $task->public_id, - 'user_id' => (int) $task->user_id, + 'user_id' => (int) $task->user->public_id, 'username' => $task->user->getDisplayName(), 'description' => $task->description ?: '', 'duration' => $task->getDuration() ?: 0,