0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

"Removed unnecessary conditional statement in buildBrewsQuery function"

This commit is contained in:
Víctor Losada Hernández
2024-08-09 22:46:25 +02:00
parent 834980890a
commit f3a774d55c

View File

@@ -36,6 +36,7 @@ const handleErrorResponse = (res, error, functionName) => {
};
const buildBrewsQuery = (legacy, v3) => {
//first off, no need to include renderers, if all are valid
if (legacy === 'true' && v3 === 'true') return { published: true };
const renderers = [];
@@ -43,7 +44,7 @@ const buildBrewsQuery = (legacy, v3) => {
if (v3 === 'true') renderers.push('V3');
const brewsQuery = { published: true };
if (renderers.length > 0) brewsQuery.renderer = { $in: renderers };
brewsQuery.renderer = { $in: renderers };
return brewsQuery;
};