1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00

Merge pull request #2492 from appwrite/fix-indexes-leftovers

feat: fix issue with listIndexes
This commit is contained in:
Torsten Dittmann 2021-12-15 15:17:34 +01:00 committed by GitHub
commit 86fc6a6ba3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1447,17 +1447,11 @@ App::get('/v1/database/collections/:collectionId/indexes')
$indexes = $collection->getAttribute('indexes');
$indexes = array_map(function ($index) use ($collection) {
return new Document([\array_merge($index, [
'collectionId' => $collection->getId(),
])]);
}, $indexes);
$usage->setParam('database.collections.read', 1);
$response->dynamic(new Document([
'sum' => \count($indexes),
'attributes' => $indexes,
'indexes' => $indexes,
]), Response::MODEL_INDEX_LIST);
});