Update SeriesController.js to respond with objects

Changes:
- `search` (GET /api/series/search)
This commit is contained in:
Paul Nettleton 2022-11-29 12:08:40 -06:00
parent e80c3a1c5a
commit 3fb2bd3362

View File

@ -32,7 +32,9 @@ class SeriesController {
var limit = (req.query.limit && !isNaN(req.query.limit)) ? Number(req.query.limit) : 25
var series = this.db.series.filter(se => se.name.toLowerCase().includes(q))
series = series.slice(0, limit)
res.json(series)
res.json({
results: series
})
}
async update(req, res) {