Remove authors search api endpoint

This commit is contained in:
advplyr 2023-09-03 09:54:23 -05:00
parent 2df95c1712
commit 1b1bdea3c8
3 changed files with 27 additions and 13 deletions

View file

@ -153,17 +153,6 @@ class AuthorController {
}
}
async search(req, res) {
var q = (req.query.q || '').toLowerCase()
if (!q) return res.json([])
var limit = (req.query.limit && !isNaN(req.query.limit)) ? Number(req.query.limit) : 25
var authors = Database.authors.filter(au => au.name?.toLowerCase().includes(q))
authors = authors.slice(0, limit)
res.json({
results: authors
})
}
async match(req, res) {
let authorData = null
const region = req.body.region || 'us'