diff --git a/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php b/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php index fe29fdc4da..03e35388f7 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/Projects/XList.php @@ -68,13 +68,13 @@ class XList extends Action ->param('queries', [], $this->getQueriesValidator(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->param('total', true, new Boolean(true), 'When set to false, the total count returned will be 0 and will not be calculated.', true) - ->inject('request') ->inject('response') ->inject('dbForPlatform') + ->inject('team') ->callback($this->action(...)); } - public function action(array $queries, string $search, bool $includeTotal, Request $request, Response $response, Database $dbForPlatform) + public function action(array $queries, string $search, bool $includeTotal, Response $response, Database $dbForPlatform, Document $team) { try { $queries = Query::parseQueries($queries); @@ -85,6 +85,10 @@ class XList extends Action if (!empty($search)) { $queries[] = Query::search('search', $search); } + + if(!$team->isEmpty()) { + $queries[] = Query::equal('teamInternalId', [$team->getSequence()]); + } $cursor = Query::getCursorQueries($queries, false); $cursor = \reset($cursor);