Implement team sequence

This commit is contained in:
Matej Bačo
2026-02-11 17:25:17 +01:00
parent 435af97db1
commit 5ac58e7723
@@ -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);