mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Merge pull request #10308 from appwrite/fix-variables-sharing-across-resources
Fix: variables sharing across resources
This commit is contained in:
commit
8f0d107d9a
1 changed files with 7 additions and 1 deletions
|
|
@ -245,10 +245,16 @@ Database::addFilter(
|
|||
return;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
$resourceType = match ($document->getCollection()) {
|
||||
'functions' => ['function'],
|
||||
'sites' => ['site'],
|
||||
default => ['function', 'site']
|
||||
};
|
||||
|
||||
return $database
|
||||
->find('variables', [
|
||||
Query::equal('resourceInternalId', [$document->getSequence()]),
|
||||
Query::equal('resourceType', ['function', 'site']),
|
||||
Query::equal('resourceType', $resourceType),
|
||||
Query::limit(APP_LIMIT_SUBQUERY),
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue