mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-06 10:42:44 +02:00
Update libraryItem model to include libraryId
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
const libraryDb = require('../db/library.db')
|
||||
const itemDb = require('../db/item.db')
|
||||
|
||||
const getAllLibraries = async (req, res) => {
|
||||
const libraries = await libraryDb.getAllLibraries()
|
||||
res.json({
|
||||
libraries
|
||||
})
|
||||
}
|
||||
|
||||
const getLibrary = async (req, res) => {
|
||||
const library = await libraryDb.getLibrary(req.params.id)
|
||||
if (!library) return res.sendStatus(404)
|
||||
res.json(library)
|
||||
}
|
||||
|
||||
const getLibraryItems = async (req, res) => {
|
||||
const libraryItems = await itemDb.getLibraryItemsForLibrary(req.params.id)
|
||||
res.json({
|
||||
libraryItems
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getAllLibraries,
|
||||
getLibrary,
|
||||
getLibraryItems
|
||||
}
|
||||
Reference in New Issue
Block a user