mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Merge remote-tracking branch 'origin/master' into fix-db-attr-number-params
This commit is contained in:
commit
1bcabf8f90
30 files changed
+443
-206
No files matched your search
@@ -166,8 +166,6 @@ App::post('/v1/database/collections')
|
||||
$collectionId = $collectionId == 'unique()' ? $dbForProject->getId() : $collectionId;
|
||||
|
||||
try {
|
||||
$dbForProject->createCollection('collection_' . $collectionId);
|
||||
|
||||
$collection = $dbForProject->createDocument('collections', new Document([
|
||||
'$id' => $collectionId,
|
||||
'$read' => $read ?? [], // Collection permissions for collection documents (based on permission model)
|
||||
@@ -179,8 +177,12 @@ App::post('/v1/database/collections')
|
||||
'name' => $name,
|
||||
'search' => implode(' ', [$collectionId, $name]),
|
||||
]));
|
||||
|
||||
$dbForProject->createCollection('collection_' . $collectionId);
|
||||
} catch (DuplicateException $th) {
|
||||
throw new Exception('Collection already exists', 409);
|
||||
} catch (LimitException $th) {
|
||||
throw new Exception('Collection limit exceeded', 400);
|
||||
}
|
||||
|
||||
$audits
|
||||
@@ -230,7 +232,7 @@ App::get('/v1/database/collections')
|
||||
$queries = [];
|
||||
|
||||
if (!empty($search)) {
|
||||
$queries[] = new Query('name', Query::TYPE_SEARCH, [$search]);
|
||||
$queries[] = new Query('search', Query::TYPE_SEARCH, [$search]);
|
||||
}
|
||||
|
||||
$usage->setParam('database.collections.read', 1);
|
||||
|
||||
Reference in new issue
Block a user