PeerTube/server/middlewares/search.js

16 lines
306 B
JavaScript

'use strict'
const searchMiddleware = {
setVideosSearch: setVideosSearch
}
function setVideosSearch (req, res, next) {
if (!req.query.field) req.query.field = 'name'
return next()
}
// ---------------------------------------------------------------------------
module.exports = searchMiddleware