From 119035463a8192fb73fbbfb3d4327664e023bfbd Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 20 Jul 2021 17:21:27 +0545 Subject: [PATCH] more fixes on collection --- app/controllers/web/console.php | 10 +++++----- app/views/console/database/collection.phtml | 2 +- app/views/console/database/index.phtml | 5 ++++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/controllers/web/console.php b/app/controllers/web/console.php index d331de8dae..d770253873 100644 --- a/app/controllers/web/console.php +++ b/app/controllers/web/console.php @@ -226,17 +226,17 @@ App::get('/console/database/collection') ->param('id', '', new UID(), 'Collection unique ID.') ->inject('response') ->inject('layout') - ->inject('projectDB') - ->action(function ($id, $response, $layout, $projectDB) { + ->inject('dbForExternal') + ->action(function ($id, $response, $layout, $dbForExternal) { /** @var Appwrite\Utopia\Response $response */ /** @var Utopia\View $layout */ - /** @var Appwrite\Database\Database $projectDB */ + /** @var Utopia\Database\Database $dbForExternal */ Authorization::disable(); - $collection = $projectDB->getDocument($id, false); + $collection = $dbForExternal->getCollection($id); Authorization::reset(); - if ($collection->isEmpty() || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) { + if ($collection->isEmpty()) { throw new Exception('Collection not found', 404); } diff --git a/app/views/console/database/collection.phtml b/app/views/console/database/collection.phtml index 1605651a12..d1da6291fa 100644 --- a/app/views/console/database/collection.phtml +++ b/app/views/console/database/collection.phtml @@ -195,7 +195,7 @@ $maxCells = 10;
- + diff --git a/app/views/console/database/index.phtml b/app/views/console/database/index.phtml index 9401ad7553..5883d8adae 100644 --- a/app/views/console/database/index.phtml +++ b/app/views/console/database/index.phtml @@ -94,7 +94,10 @@ data-failure-param-alert-text="Failed to create collection" data-failure-param-alert-classname="error"> - + + + +