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