0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-31 04:22:44 +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

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