mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
validator
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user