mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
(fix): inject dbForProject into getDatabasesDB for related collection lookups
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
95552031ef
commit
61a623fcc0
@@ -707,9 +707,9 @@ Http::setResource('dbForPlatform', function (Group $pools, Cache $cache, Authori
|
||||
return $database;
|
||||
}, ['pools', 'cache', 'authorization']);
|
||||
|
||||
Http::setResource('getDatabasesDB', function (Group $pools, Cache $cache, Document $project, Request $request, UsageContext $usage, Authorization $authorization) {
|
||||
Http::setResource('getDatabasesDB', function (Group $pools, Database $dbForProject, Cache $cache, Document $project, Request $request, UsageContext $usage, Authorization $authorization) {
|
||||
|
||||
return function (Document $database, ?Document $collection = null) use ($pools, $cache, $project, $request, $usage, $authorization): Database {
|
||||
return function (Document $database, ?Document $collection = null) use ($pools, $dbForProject, $cache, $project, $request, $usage, $authorization): Database {
|
||||
$originalDatabase = $database;
|
||||
$context = str_contains($request->getURI(), '/tablesdb/') ? 'table' : 'collection';
|
||||
$databaseDSN = $database->getAttribute('database', $project->getAttribute('database', ''));
|
||||
@@ -830,7 +830,7 @@ Http::setResource('getDatabasesDB', function (Group $pools, Cache $cache, Docume
|
||||
return $database;
|
||||
};
|
||||
|
||||
}, ['pools','cache','project','request','usage','authorization']);
|
||||
}, ['pools','dbForProject','cache','project','request','usage','authorization']);
|
||||
|
||||
Http::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache, Authorization $authorization) {
|
||||
$databases = [];
|
||||
|
||||
Reference in New Issue
Block a user