feat: add a term param to recent controller so it can be controller without req.query.term

This commit is contained in:
Barış Soner Uşaklı
2025-09-16 11:24:14 -04:00
parent 68a8db856a
commit 9c18c6fe49

View File

@@ -22,9 +22,9 @@ recentController.get = async function (req, res, next) {
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;
let term = helpers.terms[req.query.term];
let term = helpers.terms[req.query.term || selectedTerm];
const { cid, tag } = req.query;
const filter = req.query.filter || '';