fix(v2): Algolia: allow contextualSearch + facetFilters (#3804)

* remove contextualSearch facetFilters  merging security

* update doc
This commit is contained in:
Sébastien Lorber 2020-11-23 19:43:38 +01:00 committed by GitHub
parent b6cd303354
commit f1bed8dd69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 36 deletions

View file

@ -41,17 +41,5 @@ exports.validateThemeConfig = function validateThemeConfig({
validate,
themeConfig,
}) {
const normalizedThemeConfig = validate(Schema, themeConfig);
if (
normalizedThemeConfig &&
normalizedThemeConfig.algolia.contextualSearch &&
normalizedThemeConfig.algolia.searchParameters &&
normalizedThemeConfig.algolia.searchParameters.facetFilters
) {
throw new Error(
'If you are using algolia.contextualSearch: true, you should not provide algolia.searchParameters.facetFilters, as it is computed for you dynamically',
);
}
return normalizedThemeConfig;
return validate(Schema, themeConfig);
};