1
0
Fork 0
mirror of synced 2024-06-02 10:54:44 +12:00

more fixes on collection

This commit is contained in:
Damodar Lohani 2021-07-20 17:21:27 +05:45
parent acfad597fa
commit 119035463a
3 changed files with 10 additions and 7 deletions

View file

@ -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);
}

View file

@ -195,7 +195,7 @@ $maxCells = 10;
<label>&nbsp;</label>
<div class="box">
<label for="collection-name">ID</label>
<label for="collection-id">ID</label>
<input name="collectionId" id="collectionId" type="text" autocomplete="off" data-ls-bind="{{project-collection.collectionId}}" data-forms-text-direction required placeholder="Collection Id" maxlength="128" />
<label for="collection-name">Name</label>

View file

@ -94,7 +94,10 @@
data-failure-param-alert-text="Failed to create collection"
data-failure-param-alert-classname="error">
<label for="user-name">Name</label>
<label for="collection-id">ID</label>
<input type="text" class="full-width" id="collection-id" name="collectionId" required autocomplete="off" maxlength="128" />
<label for="collection-name">Name</label>
<input type="text" class="full-width" id="collection-name" name="name" required autocomplete="off" maxlength="128" />
<input type="hidden" id="collection-read" name="read" required data-cast-to="json" value="<?php echo htmlentities(json_encode([])); ?>" />