Added documents list model

This commit is contained in:
Eldad Fux committed 2020-09-13 23:38:00 +03:00
1 parent 3c8ff92e14
commit f38f83ab77
2 files changed
+14 -15

No files matched your search

+12 -15
View File
@@ -7,9 +7,6 @@ use Utopia\Validator\WhiteList;
use Utopia\Validator\Text;
use Utopia\Validator\ArrayList;
use Utopia\Validator\JSON;
// use Utopia\Locale\Locale;
// use Utopia\Audit\Audit;
// use Utopia\Audit\Adapters\MySQL as AuditAdapter;
use Appwrite\Database\Database;
use Appwrite\Database\Document;
use Appwrite\Database\Validator\UID;
@@ -403,24 +400,24 @@ App::get('/v1/database/collections/:collectionId/documents')
]),
]);
if (App::isDevelopment()) {
$collection
->setAttribute('debug', $projectDB->getDebug())
->setAttribute('limit', $limit)
->setAttribute('offset', $offset)
->setAttribute('orderField', $orderField)
->setAttribute('orderType', $orderType)
->setAttribute('orderCast', $orderCast)
->setAttribute('filters', $filters)
;
}
// if (App::isDevelopment()) {
// $collection
// ->setAttribute('debug', $projectDB->getDebug())
// ->setAttribute('limit', $limit)
// ->setAttribute('offset', $offset)
// ->setAttribute('orderField', $orderField)
// ->setAttribute('orderType', $orderType)
// ->setAttribute('orderCast', $orderCast)
// ->setAttribute('filters', $filters)
// ;
// }
$collection
->setAttribute('sum', $projectDB->getSum())
->setAttribute('documents', $list)
;
$response->json($collection->getArrayCopy(/*['$id', '$collection', 'name', 'documents']*/[], ['rules']));
$response->dynamic($collection, Response::MODEL_DOCUMENT_LIST);
}, ['response', 'projectDB']);
App::get('/v1/database/collections/:collectionId/documents/:documentId')