mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: add a term param to recent controller so it can be controller without req.query.term
This commit is contained in:
@@ -22,9 +22,9 @@ recentController.get = async function (req, res, next) {
|
|||||||
res.render('recent', data);
|
res.render('recent', data);
|
||||||
};
|
};
|
||||||
|
|
||||||
recentController.getData = async function (req, url, sort) {
|
recentController.getData = async function (req, url, sort, selectedTerm = 'alltime') {
|
||||||
const page = parseInt(req.query.page, 10) || 1;
|
const page = parseInt(req.query.page, 10) || 1;
|
||||||
let term = helpers.terms[req.query.term];
|
let term = helpers.terms[req.query.term || selectedTerm];
|
||||||
const { cid, tag } = req.query;
|
const { cid, tag } = req.query;
|
||||||
const filter = req.query.filter || '';
|
const filter = req.query.filter || '';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user