0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-20 16:12:40 +00:00

Tidy findTotal

This commit is contained in:
Trevor Buckner
2024-09-03 23:44:43 -04:00
parent 44099c813c
commit 1990064be4

View File

@@ -78,16 +78,12 @@ const findTotal = async (req, res) => {
const title = req.query.title || ''; const title = req.query.title || '';
const author = req.query.author || ''; const author = req.query.author || '';
const rendererQuery = rendererConditions(req.query.legacy, req.query.v3);
const titleQuery = titleConditions(title);
const authorQuery = authorConditions(author);
const combinedQuery = { const combinedQuery = {
$and: [ $and: [
{ published: true }, { published: true },
rendererQuery, rendererConditions(req.query.legacy, req.query.v3),
titleQuery, titleConditions(title),
authorQuery, authorConditions(author)
], ],
}; };