File tree Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 11NODE_ENV = " development"
22GRAPHQL_URL = " change me"
3- PLACEHOLDER_SMALL_IMAGE_URL = " change me"
3+ PLACEHOLDER_SMALL_IMAGE_URL = " change me"
4+ ALGOLIA_APPLICATION_ID = " change me"
5+ ALGOLIA_SEARCH_ONLY_API_KEY = " change me"
6+ ALGOLIA_INDEX_NAME = " change me"
Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ export default {
5252 name: ' ShowProducts' ,
5353 props: {
5454 products: { type: Array , required: true },
55- // TODO Add more prop types here
5655 },
5756 methods: {
5857 productImage (product ) {
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ export default {
77 env : {
88 graphqlUrl : process . env . GRAPHQL_URL || 'http://localhost:3000/graphql' ,
99 placeholderSmallImage : process . env . PLACEHOLDER_SMALL_IMAGE_URL || '' ,
10+ AlgoliaApplicationId : process . env . ALGOLIA_APPLICATION_ID || '' ,
11+ AlgoliaSearchOnlyAPIKey : process . env . ALGOLIA_SEARCH_ONLY_API_KEY || '' ,
12+ AlgoliaIndexName : process . env . ALGOLIA_INDEX_NAME || '' ,
1013 } ,
1114 // Global page headers (https://go.nuxtjs.dev/config-head)
1215 head : {
Original file line number Diff line number Diff line change 66 <ais-hits >
77 <template slot="item" slot-scope="{ item }">
88 <p >
9- <ais-highlight attribute =" name " :hit =" item" />
9+ <ais-highlight attribute =" product_name " :hit =" item" />
1010 </p >
1111 <p >
12- <ais-highlight attribute =" brand" :hit =" item" />
12+ <ais-highlight attribute =" short_description" :hit =" item" />
13+ </p >
14+ <p >
15+ <img :src =" item.product_image" alt =" item.product_name" />
1316 </p >
1417 </template >
1518 </ais-hits >
@@ -28,11 +31,12 @@ import {
2831 AisPagination ,
2932 createServerRootMixin ,
3033} from ' vue-instantsearch'
34+
3135import algoliasearch from ' algoliasearch/lite'
3236
3337const searchClient = algoliasearch (
34- ' latency ' ,
35- ' 6be0576ff61c053d5f9a3225e2a90f76 '
38+ process . env . AlgoliaApplicationId ,
39+ process . env . AlgoliaSearchOnlyAPIKey
3640)
3741
3842export default {
@@ -48,7 +52,7 @@ export default {
4852 mixins: [
4953 createServerRootMixin ({
5054 searchClient,
51- indexName: ' instant_search ' ,
55+ indexName: process . env . AlgoliaIndexName ,
5256 }),
5357 ],
5458 serverPrefetch () {
You can’t perform that action at this time.
0 commit comments