mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 14:22:52 +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:
@@ -140,7 +140,6 @@ const VaultPage = (props) => {
|
|||||||
const v3 = v3Ref.current.checked != false;
|
const v3 = v3Ref.current.checked != false;
|
||||||
const legacy = legacyRef.current.checked != false;
|
const legacy = legacyRef.current.checked != false;
|
||||||
|
|
||||||
console.log(author);
|
|
||||||
if (update) {
|
if (update) {
|
||||||
setTitle(title);
|
setTitle(title);
|
||||||
setCount(count);
|
setCount(count);
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ const handleErrorResponse = (res, error, functionName) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const buildBrewsQuery = (legacy, v3) => {
|
const buildBrewsQuery = (legacy, v3) => {
|
||||||
|
if (legacy === 'true' && v3 === 'true') return { published: true };
|
||||||
|
|
||||||
const renderers = [];
|
const renderers = [];
|
||||||
if (legacy === 'true') renderers.push('legacy');
|
if (legacy === 'true') renderers.push('legacy');
|
||||||
if (v3 === 'true') renderers.push('V3');
|
if (v3 === 'true') renderers.push('V3');
|
||||||
@@ -62,7 +64,7 @@ const vault = {
|
|||||||
const authorConditions = buildAuthorConditions(author, owner);
|
const authorConditions = buildAuthorConditions(author, owner);
|
||||||
|
|
||||||
const combinedQuery = {
|
const combinedQuery = {
|
||||||
$and: [brewsQuery, titleConditions, authorConditions]
|
$and: [brewsQuery, titleConditions, authorConditions],
|
||||||
};
|
};
|
||||||
|
|
||||||
const projection = {
|
const projection = {
|
||||||
@@ -98,7 +100,7 @@ const vault = {
|
|||||||
const authorConditions = buildAuthorConditions(author, owner);
|
const authorConditions = buildAuthorConditions(author, owner);
|
||||||
|
|
||||||
const combinedQuery = {
|
const combinedQuery = {
|
||||||
$and: [brewsQuery, titleConditions, authorConditions]
|
$and: [brewsQuery, titleConditions, authorConditions],
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
|
|||||||
Reference in New Issue
Block a user