summaryrefslogtreecommitdiff
path: root/app/Api/Procedure/TaskProcedure.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-05-22 15:33:16 -0400
committerFrederic Guillot <fred@kanboard.net>2017-05-22 15:33:16 -0400
commit54a751820f39e8891f775b8d9293349399b3e8c2 (patch)
tree777636eb37fd2dc3af959171a64eb14933641dec /app/Api/Procedure/TaskProcedure.php
parentf16ac8cd66b107f04db78a70521a959eca85159a (diff)
Add task and project API formatters
Diffstat (limited to 'app/Api/Procedure/TaskProcedure.php')
-rw-r--r--app/Api/Procedure/TaskProcedure.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/Api/Procedure/TaskProcedure.php b/app/Api/Procedure/TaskProcedure.php
index 847d336f..b1ea0516 100644
--- a/app/Api/Procedure/TaskProcedure.php
+++ b/app/Api/Procedure/TaskProcedure.php
@@ -24,19 +24,22 @@ class TaskProcedure extends BaseProcedure
public function getTask($task_id)
{
TaskAuthorization::getInstance($this->container)->check($this->getClassName(), 'getTask', $task_id);
- return $this->formatTask($this->taskFinderModel->getById($task_id));
+ $task = $this->taskFinderModel->getById($task_id);
+ return $this->taskApiFormatter->withTask($task)->format();
}
public function getTaskByReference($project_id, $reference)
{
ProjectAuthorization::getInstance($this->container)->check($this->getClassName(), 'getTaskByReference', $project_id);
- return $this->formatTask($this->taskFinderModel->getByReference($project_id, $reference));
+ $task = $this->taskFinderModel->getByReference($project_id, $reference);
+ return $this->taskApiFormatter->withTask($task)->format();
}
public function getAllTasks($project_id, $status_id = TaskModel::STATUS_OPEN)
{
ProjectAuthorization::getInstance($this->container)->check($this->getClassName(), 'getAllTasks', $project_id);
- return $this->formatTasks($this->taskFinderModel->getAll($project_id, $status_id));
+ $tasks = $this->taskFinderModel->getAll($project_id, $status_id);
+ return $this->tasksApiFormatter->withTasks($tasks)->format();
}
public function getOverdueTasks()