Skip to content

Feature/allow request options

Martijn Houtman requested to merge feature/allow-request-options into master

Allows for adding hard-coded filters and/or altering and debugging queries using hooks:

const requestOptions: RequestOptions = {
  getBaseFilters: () => (
    [{
      bool: {
        must: {
          term: {
            type: 'event',
          },
        },
      },
    }]
  ),
  hooks: {
    beforeSearch: (requests: SearchRequest[]) => {
      console.log('Query debug', requests);
      return new Promise((resolve) => {
        resolve(requests);
      });
    },
  },
};
Edited by Martijn Houtman

Merge request reports

Loading