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

feat: fix issue with listIndexes

This commit is contained in:
Christy Jacob 2021-12-14 04:42:54 +04:00
parent cc53f1bf08
commit a3e3ba9e44

View file

@ -1455,17 +1455,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);
});