Skip to content

Commit

Permalink
Fix:Get libraries endpoint #1296
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Dec 19, 2022
1 parent 0592a41 commit 3e15e09
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/controllers/LibraryController.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ class LibraryController {
findAll(req, res) {
const librariesAccessible = req.user.librariesAccessible || []
if (librariesAccessible && librariesAccessible.length) {
return res.json(this.db.libraries.filter(lib => librariesAccessible.includes(lib.id)).map(lib => lib.toJSON()))
return res.json({
libraries: this.db.libraries.filter(lib => librariesAccessible.includes(lib.id)).map(lib => lib.toJSON())
})
}

res.json({
Expand Down

0 comments on commit 3e15e09

Please sign in to comment.