Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
) => async (dispatch: any) => {
let defaultQuery = (urlEntity === entity && urlQuery) ? JSON.parse(base64url.decode(urlQuery)) : defaultQueries[entity];
defaultQuery = {...ConseilQueryBuilder.blankQuery(), ...defaultQuery};
let columns: any[] = [];
let sorts: Sort[];
let filters: Filter[] = [];
let aggregations: Aggregation[] = [];
let cardinalityPromises: any[] = [];
let query = blankQuery();
const sortedAttributes = sortAttributes(attributes);
const levelColumn = attributes.find(column => column.name === 'level' || column.name === 'block_level' || column.name === 'timestamp') || sortedAttributes[0];
if (defaultQuery) {
const { fields, predicates, orderBy } = defaultQuery;
query = defaultQuery;
// initColumns
if (fields.length > 0) {
fields.forEach(field=> {
const column = attributes.find(attr => attr.name === field);