From 1b1877db06d22df2fc695ebad4768221925ed735 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 21 Jul 2021 11:32:01 +0545 Subject: [PATCH] update to new db --- app/controllers/web/console.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index d770253873..75bbb87c7e 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -264,16 +264,16 @@ App::get('/console/database/document') ->label('scope', 'console') ->param('collection', '', new UID(), 'Collection unique ID.') ->inject('layout') - ->inject('projectDB') - ->action(function ($collection, $layout, $projectDB) { + ->inject('dbForExternal') + ->action(function ($collection, $layout, $dbForExternal) { /** @var Utopia\View $layout */ - /** @var Appwrite\Database\Database $projectDB */ + /** @var Utopia\Database\Database $dbForExternal */ Authorization::disable(); - $collection = $projectDB->getDocument($collection, false); + $collection = $dbForExternal->getCollection($collection); Authorization::reset(); - if ($collection->isEmpty() || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { + if ($collection->isEmpty()) { throw new Exception('Collection not found', 404); } @@ -282,7 +282,7 @@ App::get('/console/database/document') $searchDocuments = new View(__DIR__.'/../../views/console/database/search/documents.phtml'); $page - ->setParam('db', $projectDB) + ->setParam('db', $dbForExternal) ->setParam('collection', $collection) ->setParam('searchFiles', $searchFiles) ->setParam('searchDocuments', $searchDocuments)