From 3fb2bd336207fb4389327cf74f077b6126fc2232 Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Tue, 29 Nov 2022 12:08:40 -0600 Subject: [PATCH] Update SeriesController.js to respond with objects Changes: - `search` (GET /api/series/search) --- server/controllers/SeriesController.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/controllers/SeriesController.js b/server/controllers/SeriesController.js index 678f30e0..c5b56edf 100644 --- a/server/controllers/SeriesController.js +++ b/server/controllers/SeriesController.js @@ -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) {