add to cart error handling

This commit is contained in:
sidharth 2022-02-24 12:46:06 +05:30
parent e59452ddf3
commit f1bad5cf21
2 changed files with 7 additions and 22 deletions

View File

@ -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>

View File

@ -179,7 +179,6 @@ export default {
},
async addToCart(sku,qty) {
if (sku) {
debugger
if (this.userAuth) {
await this.$store
.dispatch("userCartProduct/addToCart", {
@ -196,14 +195,14 @@ export default {
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