Skip to content

Commit

Permalink
[backend] Fix public dashboard area chart time serie (#6753)
Browse files Browse the repository at this point in the history
  • Loading branch information
SouadHadjiat authored Apr 18, 2024
1 parent 15681aa commit 7f9c8b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion opencti-platform/opencti-graphql/src/database/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1860,7 +1860,9 @@ const buildSubQueryForFilterGroup = async (context, user, inputFilters) => {
const group = filterGroups[index];
if (isFilterGroupNotEmpty(group)) {
const subQuery = await buildSubQueryForFilterGroup(context, user, group);
localMustFilters.push(subQuery);
if (subQuery) { // can be null
localMustFilters.push(subQuery);
}
}
}
// Handle filters
Expand Down Expand Up @@ -2596,6 +2598,7 @@ export const elCount = async (context, user, indexName, options = {}) => {
export const elHistogramCount = async (context, user, indexName, options = {}) => {
const { interval, field, types = null } = options;
const body = await elQueryBodyBuilder(context, user, { ...options, dateAttribute: field, noSize: true, noSort: true, intervalInclude: true });
body.size = 0; // we only need aggregations
let dateFormat;
switch (interval) {
case 'year':
Expand Down

0 comments on commit 7f9c8b9

Please sign in to comment.