diff options
Diffstat (limited to 'app/Api')
-rw-r--r-- | app/Api/Base.php | 1 | ||||
-rw-r--r-- | app/Api/Task.php | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/Api/Base.php b/app/Api/Base.php index 0959817e..2cc62da8 100644 --- a/app/Api/Base.php +++ b/app/Api/Base.php @@ -40,6 +40,7 @@ abstract class Base extends \Kanboard\Core\Base 'getBoard', 'getProjectActivity', 'getOverdueTasksByProject', + 'searchTasks', ); public function checkProcedurePermission($is_user, $procedure) diff --git a/app/Api/Task.php b/app/Api/Task.php index 202e9bb5..1d1211f2 100644 --- a/app/Api/Task.php +++ b/app/Api/Task.php @@ -2,6 +2,7 @@ namespace Kanboard\Api; +use Kanboard\Filter\TaskProjectFilter; use Kanboard\Model\Task as TaskModel; /** @@ -12,6 +13,12 @@ use Kanboard\Model\Task as TaskModel; */ class Task extends Base { + public function searchTasks($project_id, $query) + { + $this->checkProjectPermission($project_id); + return $this->taskLexer->build($query)->withFilter(new TaskProjectFilter($project_id))->toArray(); + } + public function getTask($task_id) { $this->checkTaskPermission($task_id); |