Skip to content

Commit af8eedb

Browse files
committed
Removed hardcoded index name
Removed hardcoded index name and made it configurable inside of nextConfig.js
1 parent 9567fd8 commit af8eedb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

components/Search/AlgoliaSearchBox.component.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const AlgoliaSearchBox = () => {
2424
<div className="hidden mt-2 md:inline xl:inline">
2525
<div className="">
2626
<InstantSearch
27-
indexName="wp_posts_product"
27+
indexName={WOO_CONFIG.ALGOLIA_INDEX_NAME}
2828
searchClient={searchClient}
2929
>
3030
{/*We need to conditionally add a border because the element has position:fixed*/}

utils/config/nextConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const WOO_CONFIG = {
66
GRAPHQL_URL: 'https://woocommerce.dfweb.no/graphql',
77
ALGOLIA_APP_ID: '7L9M5Y0B1K',
88
ALGOLIA_PUBLIC_API_KEY: '925cc92373120f1bf477bb8ce0e71649',
9+
ALGOLIA_INDEX_NAME: 'dfweb',
910
};
1011

1112
// Development details

0 commit comments

Comments
 (0)