From 226ad49663737db6949a0fd3feb17d619d12c5a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Sun, 1 Sep 2024 19:12:25 +0200 Subject: [PATCH] renaming to keep some consistency --- server/vault.api.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/server/vault.api.js b/server/vault.api.js index b03d2bb5b..a652c5f93 100644 --- a/server/vault.api.js +++ b/server/vault.api.js @@ -20,16 +20,16 @@ const authorConditions = (author) => { }; const rendererConditions = (legacy, v3) => { - const brewsQuery = {}; + const renderer = {}; if (legacy === 'true' && v3 !== 'true') { - brewsQuery.renderer = 'legacy'; + renderer.renderer = 'legacy'; } else if (v3 === 'true' && legacy !== 'true') { - brewsQuery.renderer = 'V3'; + renderer.renderer = 'V3'; } //if all renderers are selected, doesn't make sense to add them to the query, it would only take longer - return brewsQuery; + return renderer; }; const findBrews = async (req, res) => { @@ -40,16 +40,16 @@ const findBrews = async (req, res) => { const count = Math.max(parseInt(req.query.count) || 20, mincount); const skip = (page - 1) * count; - const brewsQuery = rendererConditions(req.query.legacy, req.query.v3); - const titleConditions = titleConditions(title); - const authorConditions = authorConditions(author); + const rendererQuery = rendererConditions(req.query.legacy, req.query.v3); + const titleQuery = titleConditions(title); + const authorQuery = authorConditions(author); const combinedQuery = { $and: [ { published: true }, - brewsQuery, - titleConditions, - authorConditions, + rendererQuery, + titleQuery, + authorQuery, ], }; @@ -84,16 +84,16 @@ const findTotal = async (req, res) => { const title = req.query.title || ''; const author = req.query.author || ''; - const brewsQuery = rendererConditions(req.query.legacy, req.query.v3); - const titleConditions = titleConditions(title); - const authorConditions = authorConditions(author); + const rendererQuery = rendererConditions(req.query.legacy, req.query.v3); + const titleQuery = titleConditions(title); + const authorQuery = authorConditions(author); const combinedQuery = { $and: [ { published: true }, - brewsQuery, - titleConditions, - authorConditions, + rendererQuery, + titleQuery, + authorQuery, ], };