Skip to content

Commit

Permalink
add changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vashjs committed Nov 7, 2023
1 parent 5482526 commit 62fdd88
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions src/QueryBuilder/QueryBuilder/helpers/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,24 @@ export const mongoQueryToSource = async ({

// handle case when query contains boolean operators (AND, OR, etc.)
if (Object.values(BOOLEAN_OPERATORS).includes(key)) {
return initialValues[key].map((item) => getFormattedSourceField({
item,
...sharedArgs,
}));
const formattedSource = [];

for (const item of initialValues[key]) {
const formattedItem = await getFormattedSourceField({
item,
...sharedArgs,
});

formattedSource.push(formattedItem);
}

return formattedSource;
}

return [
getFormattedSourceField({
item: initialValues,
...sharedArgs,
}),
];
const singleItem = await getFormattedSourceField({
item: initialValues,
...sharedArgs,
});

return [singleItem];
};

0 comments on commit 62fdd88

Please sign in to comment.