* feat: add personalized recommendations (#1024)
* use Algolia for personalized recommendations
* show personalized recommendations to use that have consented
to functional cookies
* update tests
VAN-1599
* Revert "fix: special characters in redirect url getting decoded to space (#1029)" (#1030)
This reverts commit fc62241332.
* feat: update recommendations page design (#1036)
VAN-1598
* feat: add events for recommendations (#1039)
* feat: remove static recommendations
---------
Co-authored-by: Syed Sajjad Hussain Shah <52817156+syedsajjadkazmii@users.noreply.github.com>
21 lines
519 B
JavaScript
21 lines
519 B
JavaScript
import { getConfig } from '@edx/frontend-platform';
|
|
import algoliasearch from 'algoliasearch';
|
|
|
|
// initialize Algolia workers
|
|
const initializeSearchClient = () => algoliasearch(
|
|
getConfig().ALGOLIA_APP_ID,
|
|
getConfig().ALGOLIA_SEARCH_API_KEY,
|
|
);
|
|
|
|
const getLocationRestrictionFilter = (userCountry) => {
|
|
if (userCountry) {
|
|
return `NOT blocked_in:"${userCountry}" AND (allowed_in:"null" OR allowed_in:"${userCountry}")`;
|
|
}
|
|
return '';
|
|
};
|
|
|
|
export {
|
|
initializeSearchClient,
|
|
getLocationRestrictionFilter,
|
|
};
|