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

"Removed console log statement in VaultPage.jsx and updated brewsQuery logic in vault.api.js to handle legacy and v3 filters"

This commit is contained in:
Víctor Losada Hernández
2024-07-28 11:10:27 +02:00
parent 59a5f641af
commit 5a9b77190a
2 changed files with 4 additions and 3 deletions

View File

@@ -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);

View File

@@ -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(