Fix:Get libraries endpoint #1296

This commit is contained in:
advplyr 2022-12-19 17:46:32 -06:00
parent 0592a41d4f
commit 3e15e09c07

View File

@ -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({