Update CollectionController.js to respond with objects

Changes:
- `findAll` (GET /api/collections)
This commit is contained in:
Paul Nettleton 2022-11-29 11:48:21 -06:00
parent 0851050392
commit b8f74e1c98

View File

@ -20,8 +20,9 @@ class CollectionController {
}
findAll(req, res) {
var expandedCollections = this.db.collections.map(c => c.toJSONExpanded(this.db.libraryItems))
res.json(expandedCollections)
res.json({
collections: this.db.collections.map(c => c.toJSONExpanded(this.db.libraryItems))
})
}
findOne(req, res) {