From 5a9b77190a027d6028fe2af8441a5e66f7869dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Sun, 28 Jul 2024 11:10:27 +0200 Subject: [PATCH] "Removed console log statement in VaultPage.jsx and updated brewsQuery logic in vault.api.js to handle legacy and v3 filters" --- client/homebrew/pages/vaultPage/vaultPage.jsx | 1 - server/vault.api.js | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/homebrew/pages/vaultPage/vaultPage.jsx b/client/homebrew/pages/vaultPage/vaultPage.jsx index 0ccd1144b..c18e3f8c5 100644 --- a/client/homebrew/pages/vaultPage/vaultPage.jsx +++ b/client/homebrew/pages/vaultPage/vaultPage.jsx @@ -140,7 +140,6 @@ const VaultPage = (props) => { const v3 = v3Ref.current.checked != false; const legacy = legacyRef.current.checked != false; - console.log(author); if (update) { setTitle(title); setCount(count); diff --git a/server/vault.api.js b/server/vault.api.js index 369e73ff1..6955d22ba 100644 --- a/server/vault.api.js +++ b/server/vault.api.js @@ -33,6 +33,8 @@ const handleErrorResponse = (res, error, functionName) => { }; const buildBrewsQuery = (legacy, v3) => { + if (legacy === 'true' && v3 === 'true') return { published: true }; + const renderers = []; if (legacy === 'true') renderers.push('legacy'); if (v3 === 'true') renderers.push('V3'); @@ -62,7 +64,7 @@ const vault = { const authorConditions = buildAuthorConditions(author, owner); const combinedQuery = { - $and: [brewsQuery, titleConditions, authorConditions] + $and: [brewsQuery, titleConditions, authorConditions], }; const projection = { @@ -98,7 +100,7 @@ const vault = { const authorConditions = buildAuthorConditions(author, owner); const combinedQuery = { - $and: [brewsQuery, titleConditions, authorConditions] + $and: [brewsQuery, titleConditions, authorConditions], }; console.log(