Skip to content

Commit 4faf798

Browse files
authored
Merge pull request #169 from w3bdesign/dev
Refresh page if we have an error
2 parents bbbe3d2 + dd7e168 commit 4faf798

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

components/Header/Cart.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export default {
6666
},
6767
error(error) {
6868
this.remoteError = error
69+
window.location.reload(true)
6970
},
7071
},
7172
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nuxtjs-woocommerce",
3-
"version": "1.0.13",
3+
"version": "1.0.14",
44
"private": true,
55
"scripts": {
66
"dev": "nuxt",

pages/search.vue

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<NuxtLink
99
class="text-black cursor-pointer hover:underline"
1010
:to="{
11-
path: '/product/' + item.product_name,
11+
path: '/product/' + convertProductNameToSlug(item.product_name),
1212
query: { id: item.objectID },
1313
}"
1414
>
@@ -33,12 +33,6 @@
3333
</template>
3434

3535
<script>
36-
// TODO
37-
/*
38-
Replace empty spaces with dash (-)
39-
40-
const trimmedProductName = product_name.replace(/ /g, '-');
41-
*/
4236
import {
4337
AisInstantSearchSsr,
4438
AisRefinementList,
@@ -72,12 +66,6 @@ export default {
7266
}),
7367
],
7468
layout: 'Layout',
75-
serverPrefetch() {
76-
return this.instantsearch.findResultsState(this).then((algoliaState) => {
77-
this.$ssrContext.nuxt.algoliaState = algoliaState
78-
})
79-
},
80-
8169
head() {
8270
return {
8371
link: [
@@ -95,5 +83,16 @@ export default {
9583
9684
this.instantsearch.hydrate(results)
9785
},
86+
methods: {
87+
convertProductNameToSlug(productName) {
88+
const productNameSlug = productName.replace(/ /g, '-').toLowerCase()
89+
return productNameSlug
90+
},
91+
},
92+
serverPrefetch() {
93+
return this.instantsearch.findResultsState(this).then((algoliaState) => {
94+
this.$ssrContext.nuxt.algoliaState = algoliaState
95+
})
96+
},
9897
}
9998
</script>

0 commit comments

Comments
 (0)