huridocs/uwazi

View on GitHub
app/react/ToggledFeatures/tocGeneration/utils.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { ClientSettings } from 'app/apiResponseTypes';
import { SearchParams } from 'shared/types/searchParameterType';

export const tocGenerationUtils = {
  aggregations(params: SearchParams, settings: ClientSettings) {
    return {
      ...params,
      ...(settings?.features?.tocGeneration ? { aggregateGeneratedToc: true } : {}),
    };
  },
};