Skip to content

Commit

Permalink
Merge pull request #1554 from /issues/1553
Browse files Browse the repository at this point in the history
apply coupon box not displaying bug fixed
  • Loading branch information
varsha766 authored Aug 12, 2022
2 parents 135c5f5 + 038019d commit f1cb26c
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/components/admin/selectPlanSlider/SelectPlanSlide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ export default {
// {"actionTypes":["INPUT_TEXT","INPUT_NUMBER","TWITTER_FOLLOW","TWITTER_RETWEET","TELEGRAM_JOIN","DISCORD_JOIN","BLOCKCHAIN_ETH","BLOCKCHAIN_TEZ","HYPERSIGN_AUTH"],"length":9}
authToken: localStorage.getItem("authToken"),
showCoupon:false,
couponCount:0,
subTotal: 0,
discount: 0,
couponDiscount: 0,
Expand Down Expand Up @@ -328,6 +327,7 @@ export default {
handleInput(e){
if (e.key === "Backspace" || e.key === "Delete") {
this.couponDiscount=0;
this.coupons = []
}
},
async applyCoupon(){
Expand All @@ -340,11 +340,8 @@ export default {
}
if(!this.coupons.includes(this.coupon)){
this.grandTotal
if(!this.couponCount>0){
this.isLoading = true;
const url = `${this.$config.studioServer.BASE_URL}api/v1/subscription/coupon/verify`;
// console.log(this.coupon)
let headers = {
"Content-Type": "application/json",
Authorization: `Bearer ${this.authToken}`,
Expand All @@ -363,7 +360,6 @@ export default {
if (!resp.ok) {
return this.notifyErr(json);
} else {
this.couponCount = 1;
this.coupons.push(this.coupon)
this.couponDiscount = (this.plan.grandTotal * this.fetchedCouponDiscount) / 100;
return this.notifySuccess("Coupon Applied");
Expand All @@ -376,6 +372,8 @@ export default {
return this.notifyErr("coupon code already applied")
}
}
else{
return this.notifyErr(Messages.SUBSCRIPTIONS.SELECT_CURRENCY_AND_NETWORK)
}
}catch(e){
return this.notifyErr(e.message)
Expand All @@ -386,7 +384,6 @@ export default {
},
resetAllValues() {
this.coupons = [];
this.couponCount = 0;
this.showCoupon = false;
this.discount = 0;
this.couponDiscount = 0;
Expand All @@ -402,17 +399,17 @@ export default {
},
resetAllPayment(){
this.coupon = "";
this.showCoupon = false;
this.discount = 0;
this.couponDiscount = 0;
this.couponCount = 0;
this.coupons = []
},
setDiscount(__arg) {
if (__arg) {
if (__arg == "HID") {
this.resetAllPayment();
if(this.selectedNetwork==="BSC"){
this.selectedNetwork = "";
}
this.options.network = [
{ text: "Ethereum", value: "ETH", disabled: false },
{ text: "Polygon", value: "MATIC", disabled: false },
Expand Down Expand Up @@ -458,7 +455,6 @@ export default {
}
if (__arg == "USDT") {
this.resetAllPayment();
this.selectedNetwork = "";
this.options.network = [
{ text: "Ethereum", value: "ETH", disabled: false },
{ text: "Polygon", value: "MATIC", disabled: false },
Expand All @@ -469,7 +465,6 @@ export default {
}
if (__arg == "USDC") {
this.resetAllPayment();
this.selectedNetwork = "";
this.options.network = [
{ text: "Ethereum", value: "ETH", disabled: false },
{ text: "Polygon", value: "MATIC", disabled: false },
Expand Down

0 comments on commit f1cb26c

Please sign in to comment.