mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-26 10:49:00 +02:00
Update:API endpoint /search/podcast throw 400 error if term query param is not supplied
This commit is contained in:
parent
05820aa820
commit
dc67a52000
1 changed files with 11 additions and 0 deletions
|
@ -35,8 +35,19 @@ class SearchController {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Find podcast RSS feeds given a term
|
||||
*
|
||||
* @param {import('express').Request} req
|
||||
* @param {import('express').Response} res
|
||||
*/
|
||||
async findPodcasts(req, res) {
|
||||
const term = req.query.term
|
||||
if (!term) {
|
||||
Logger.error('[SearchController] Invalid request query param "term" is required')
|
||||
return res.status(400).send('Invalid request query param "term" is required')
|
||||
}
|
||||
|
||||
const results = await PodcastFinder.search(term)
|
||||
res.json(results)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue