|
|
@ -36,9 +36,11 @@ modsController.flags.list = async function (req, res) {
|
|
|
|
|
|
|
|
|
|
|
|
// Parse query string params for filters, eliminate non-valid filters
|
|
|
|
// Parse query string params for filters, eliminate non-valid filters
|
|
|
|
filters = filters.reduce((memo, cur) => {
|
|
|
|
filters = filters.reduce((memo, cur) => {
|
|
|
|
if (req.query.hasOwnProperty(cur) && typeof req.query[cur] === 'string') {
|
|
|
|
if (req.query.hasOwnProperty(cur)) {
|
|
|
|
if (req.query[cur].trim() !== '') {
|
|
|
|
if (typeof req.query[cur] === 'string' && req.query[cur].trim() !== '') {
|
|
|
|
memo[cur] = req.query[cur].trim();
|
|
|
|
memo[cur] = req.query[cur].trim();
|
|
|
|
|
|
|
|
} else if (Array.isArray(req.query[cur]) && req.query[cur].length) {
|
|
|
|
|
|
|
|
memo[cur] = req.query[cur];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|