add to cart error handling
This commit is contained in:
parent
e59452ddf3
commit
f1bad5cf21
|
@ -68,14 +68,7 @@
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col class="py-0 ma-0">
|
<v-col class="py-0 ma-0">
|
||||||
<p
|
<p
|
||||||
class="fontsize-14 black--text float-left cursor-pointer"
|
class="fontsize-14 black--text float-left"
|
||||||
@click="
|
|
||||||
goToProductDetails(
|
|
||||||
product.customAttributes,
|
|
||||||
product.name,
|
|
||||||
product.productType
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
{{ product.name }}
|
{{ product.name }}
|
||||||
</p>
|
</p>
|
||||||
|
@ -290,14 +283,7 @@
|
||||||
<v-col cols="12" sm="6" md="5" lg="6">
|
<v-col cols="12" sm="6" md="5" lg="6">
|
||||||
<v-row>
|
<v-row>
|
||||||
<p
|
<p
|
||||||
class="fontsize-14 black--text float-left cursor-pointer"
|
class="fontsize-14 black--text float-left"
|
||||||
@click="
|
|
||||||
goToProductDetails(
|
|
||||||
product.customAttributes,
|
|
||||||
product.name,
|
|
||||||
product.productType
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
{{ product.name }}
|
{{ product.name }}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -179,7 +179,6 @@ export default {
|
||||||
},
|
},
|
||||||
async addToCart(sku,qty) {
|
async addToCart(sku,qty) {
|
||||||
if (sku) {
|
if (sku) {
|
||||||
debugger
|
|
||||||
if (this.userAuth) {
|
if (this.userAuth) {
|
||||||
await this.$store
|
await this.$store
|
||||||
.dispatch("userCartProduct/addToCart", {
|
.dispatch("userCartProduct/addToCart", {
|
||||||
|
@ -196,14 +195,14 @@ export default {
|
||||||
show: true,
|
show: true,
|
||||||
timeout: 2000
|
timeout: 2000
|
||||||
};
|
};
|
||||||
debugger
|
|
||||||
this.$store.dispatch("userCartProduct/cartProductList");
|
this.$store.dispatch("userCartProduct/cartProductList");
|
||||||
this.$emit("actionClose", this.snackbar);
|
this.$emit("actionClose", this.snackbar);
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch((error) => {
|
||||||
|
console.log("error",error)
|
||||||
this.snackbar = {
|
this.snackbar = {
|
||||||
message: 'Unexpected error while communicating with the cloud',
|
message: error.message,
|
||||||
color: "error",
|
color: "error",
|
||||||
show: true,
|
show: true,
|
||||||
timeout: 2000
|
timeout: 2000
|
||||||
|
|
Loading…
Reference in New Issue