mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Fix backwards compatibility
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Appwrite\Utopia\Request\Filters;
|
||||
|
||||
use Appwrite\Query;
|
||||
use Appwrite\Utopia\Request\Filter;
|
||||
|
||||
class V21 extends Filter
|
||||
@@ -13,6 +14,12 @@ class V21 extends Filter
|
||||
case 'webhooks.create':
|
||||
$content = $this->fillWebhookid($content);
|
||||
break;
|
||||
case 'project.createVariable':
|
||||
$content = $this->fillVariableId($content);
|
||||
break;
|
||||
case 'project.listVariables':
|
||||
$content = $this->preserveVariablesQueries($content);
|
||||
break;
|
||||
case 'functions.createTemplateDeployment':
|
||||
case 'sites.createTemplateDeployment':
|
||||
$content = $this->convertVersionToTypeAndReference($content);
|
||||
@@ -57,4 +64,19 @@ class V21 extends Filter
|
||||
$content['webhookId'] = $content['webhookId'] ?? 'unique()';
|
||||
return $content;
|
||||
}
|
||||
|
||||
protected function fillVariableId(array $content): array
|
||||
{
|
||||
$content['variableId'] = $content['variableId'] ?? 'unique()';
|
||||
return $content;
|
||||
}
|
||||
|
||||
protected function preserveVariablesQueries(array $content): array
|
||||
{
|
||||
$content['queries'] = $content['queries'] ?? [
|
||||
Query::limit(APP_LIMIT_SUBQUERY)
|
||||
];
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user