Skip to content

Commit

Permalink
fix query bug of empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Dec 12, 2019
1 parent 13092da commit c341b98
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export async function generateCsvSearch(

let payloadQuery: QueryFilter | undefined;
let payloadSort: any[] = [];
let docValueFields: any[] = [];
let docValueFields: any[] | undefined;
if (jobParams.post && jobParams.post.state) {
({
post: {
Expand Down Expand Up @@ -118,7 +118,11 @@ export async function generateCsvSearch(
}, {});

if (indexPatternTimeField) {
docValueFields = [indexPatternTimeField].concat(docValueFields);
if (docValueFields) {
docValueFields = [indexPatternTimeField].concat(docValueFields);
} else {
docValueFields = [indexPatternTimeField];
}
}

const searchRequest: SearchRequest = {
Expand Down

0 comments on commit c341b98

Please sign in to comment.