mirror of
https://github.com/appwrite/appwrite
synced 2026-05-05 22:38:37 +00:00
Improve customization of queries validator
This commit is contained in:
parent
bf59f1ba7d
commit
ca6cf01773
1 changed files with 5 additions and 5 deletions
|
|
@ -28,13 +28,13 @@ class XList extends Action
|
|||
return 'listProjects';
|
||||
}
|
||||
|
||||
// Stored as property intentionally for extensibility
|
||||
protected Validator $queriesValidator;
|
||||
protected function getQueriesValidator(): Validator
|
||||
{
|
||||
return new Projects();
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->queriesValidator = new Projects();
|
||||
|
||||
$this
|
||||
->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/projects')
|
||||
|
|
@ -57,7 +57,7 @@ class XList extends Action
|
|||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('queries', [], $this->queriesValidator, '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', [], $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)
|
||||
->inject('response')
|
||||
->inject('dbForPlatform')
|
||||
|
|
|
|||
Loading…
Reference in a new issue