Update promo-modal-question.vue

This commit is contained in:
Sneha 2023-11-13 19:44:38 +05:30
parent 3873c23716
commit 33d2db26d7

View file

@ -50,9 +50,7 @@ import promoQuestion from "@/layouts/payment-method/promo-modal-question/promo-q
import modal from "@/digital-components/modal/modal"; import modal from "@/digital-components/modal/modal";
import alert from "@/ux-components/alert/alert"; import alert from "@/ux-components/alert/alert";
import { storeActions } from "@/constants/store-actions.js"; import { storeActions } from "@/constants/store-actions.js";
import { import { getVapsThatNeedToBeAddedToSatisfyPromos } from "@/helpers/promotions-helper";
getVapsThatNeedToBeAddedToSatisfyPromos,
} from "@/helpers/promotions-helper";
import { deepClone } from "@/helpers/object-helper"; import { deepClone } from "@/helpers/object-helper";
import baseMixin from "@/mixins/base-mixin.js"; import baseMixin from "@/mixins/base-mixin.js";
import { cartItemCategories } from "@/constants/cart-item-categories"; import { cartItemCategories } from "@/constants/cart-item-categories";
@ -183,19 +181,16 @@ export default {
if (promoCodeData.isValid) { if (promoCodeData.isValid) {
const pricedLineItemsToTax = []; const pricedLineItemsToTax = [];
pricedLineItemsToTax.push(...promoCodeData.promoCode); pricedLineItemsToTax.push(...promoCodeData.promoCode);
const taxedLineItems = const taxedLineItems = await baseMixin.methods.dispatchStoreActionWithLogging(
await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA, storeActions.TAX_ORDER_ITEMS_AND_SAVE_SERVER_DATA,
{ {
billToAccountNumber: "87291", billToAccountNumber: "87291",
providerNumber: providerNumber:
store.getters.order.serviceLocation.provider.providerNumber, store.getters.order.serviceLocation.provider.providerNumber,
appointmentType: appointmentType: store.getters.order.serviceLocation.appointmentType,
store.getters.order.serviceLocation.appointmentType,
serviceLocationCity: store.getters.order.serviceLocation.city, serviceLocationCity: store.getters.order.serviceLocation.city,
serviceLocationState: store.getters.order.serviceLocation.state, serviceLocationState: store.getters.order.serviceLocation.state,
serviceLocationZipCode: serviceLocationZipCode: store.getters.order.serviceLocation.zipCode,
store.getters.order.serviceLocation.zipCode,
pricedLineItems: pricedLineItemsToTax, pricedLineItems: pricedLineItemsToTax,
}, },
"payment-method", "payment-method",
@ -203,10 +198,7 @@ export default {
); );
// Match all line items to the line items as they are in the store // Match all line items to the line items as they are in the store
// and rebuild the original structure. // and rebuild the original structure.
this.lineItems = mapTaxedLineItemsToStoreFormat( this.lineItems = mapTaxedLineItemsToStoreFormat(taxedLineItems, this.lineItems);
taxedLineItems,
this.lineItems
);
const taxedVaps = mapTaxedLineItemsToStoreFormat( const taxedVaps = mapTaxedLineItemsToStoreFormat(
taxedLineItems, taxedLineItems,
this.availableVaps this.availableVaps
@ -223,8 +215,7 @@ export default {
this.$emit("update:modelValue", this.lineItems); this.$emit("update:modelValue", this.lineItems);
this.promoCode = ""; this.promoCode = "";
} else { } else {
if(promoCodeData.errorCode == "PromoStackingNotAllowed") if (promoCodeData.errorCode == "PromoStackingNotAllowed") {
{
this.displayInvalidPromoOnOrderAlert = true; this.displayInvalidPromoOnOrderAlert = true;
this.focusOnPromoInput(); this.focusOnPromoInput();
this.resetModalButtonStyle(); this.resetModalButtonStyle();