validator

This commit is contained in:
fogelito
2026-01-22 15:56:11 +02:00
parent 27121a7f1e
commit 82032ac60a
2 changed files with 11 additions and 4 deletions
@@ -64,7 +64,7 @@ class XList extends Action
],
contentType: ContentType::JSON
))
->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('queries', [], new Projects(), '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')
@@ -4,11 +4,18 @@ namespace Appwrite\Utopia\Database\Validator\Queries;
class Projects extends Base
{
public const ALLOWED_ATTRIBUTES = [
// public const ALLOWED_ATTRIBUTES = [
// 'name',
// 'teamId',
// 'labels',
// 'search'
// ];
protected array $allowed = [
'name',
'teamId',
'labels',
'search'
'search',
];
/**
@@ -17,7 +24,7 @@ class Projects extends Base
*/
public function __construct()
{
parent::__construct('projects', self::ALLOWED_ATTRIBUTES);
parent::__construct('projects', $this->allowed);
}
public function isSelectQueryAllowed(): bool