From d21244ff41851626099b3d5721562aeb01c91b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 2 Sep 2025 11:42:35 +0200 Subject: [PATCH] PR review changes --- .../Platform/Modules/Compute/Base.php | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Compute/Base.php b/src/Appwrite/Platform/Modules/Compute/Base.php index d499f4b4aa..e58f2b8664 100644 --- a/src/Appwrite/Platform/Modules/Compute/Base.php +++ b/src/Appwrite/Platform/Modules/Compute/Base.php @@ -4,14 +4,12 @@ namespace Appwrite\Platform\Modules\Compute; use Appwrite\Event\Build; use Appwrite\Extend\Exception; -use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Exception\Duplicate; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; -use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; use Utopia\Platform\Action; use Utopia\Swoole\Request; @@ -21,47 +19,6 @@ use Utopia\VCS\Exception\RepositoryNotFound; class Base extends Action { - /** - * Helper to apply select queries - * - * Method to respect request select queries in response format, - * to prevent default rule values from being applied on not-selected attributes - * - * @param Request $request - * @param Document $document - * @return void - */ - public function applySelectQueries(Request $request, Response $response, string $model): void - { - $queries = $request->getParam('queries', []); - - $queries = Query::parseQueries($queries); - $selectQueries = Query::groupByType($queries)['selections'] ?? []; - - // No select queries means no filtering out - if (empty($selectQueries)) { - return; - } - - $attributes = []; - foreach ($selectQueries as $query) { - foreach ($query->getValues() as $attribute) { - $attributes[] = $attribute; - } - } - - $responseModel = $response->getModel($model); - foreach ($responseModel->getRules() as $ruleName => $rule) { - if (\str_starts_with($ruleName, '$')) { - continue; - } - - if (!\in_array($ruleName, $attributes)) { - $responseModel->removeRule($ruleName); - } - } - } - public function redeployVcsFunction(Request $request, Document $function, Document $project, Document $installation, Database $dbForProject, Build $queueForBuilds, Document $template, GitHub $github, bool $activate, string $referenceType = 'branch', string $reference = ''): Document { $deploymentId = ID::unique();