diff --git a/src/helpers/promotions-helper.js b/src/helpers/promotions-helper.js index 1c5170f14..f91a7a91b 100644 --- a/src/helpers/promotions-helper.js +++ b/src/helpers/promotions-helper.js @@ -246,7 +246,10 @@ export function getVapsThatNeedToBeAddedToSatisfyPromos( } } -export function removeCurrentlyActivePromoCodesFromInactivePromos(activePromoObjects, inactivePromos) { +export function removeCurrentlyActivePromoCodesFromInactivePromos( + activePromoObjects, + inactivePromos +) { activePromoObjects = activePromoObjects ?? []; inactivePromos = inactivePromos ?? []; const activePromoCodes = activePromoObjects.map((promoObject) => diff --git a/src/store/index.js b/src/store/index.js index 678a48cbb..320ff3e28 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -23,8 +23,10 @@ import { getDisplayTextForDurationLength, } from "@/layouts/schedule/helpers/schedule-helper"; import { paymentMethods } from "@/constants/payment-method-constants"; -import { getPromoCodeWithoutBundleIdentifier, - removeCurrentlyActivePromoCodesFromInactivePromos } from "@/helpers/promotions-helper"; +import { + getPromoCodeWithoutBundleIdentifier, + removeCurrentlyActivePromoCodesFromInactivePromos, +} from "@/helpers/promotions-helper"; import { getDateDifferenceInDays } from "@/helpers/date-helper"; // Export State const getDefaultState = () => { @@ -2132,7 +2134,10 @@ export const actions = { } else if (activePromos && inactivePromos) { // Prioritize active promos when both inactive and active are supplied activePromosToSave = activePromos; - inactivePromosToSave = removeCurrentlyActivePromoCodesFromInactivePromos(activePromosToSave, inactivePromos); + inactivePromosToSave = removeCurrentlyActivePromoCodesFromInactivePromos( + activePromosToSave, + inactivePromos + ); } else if (!activePromos) { // Only inactivePromos supplied inactivePromosToSave = inactivePromos; @@ -2144,7 +2149,10 @@ export const actions = { } else if (!inactivePromos) { // Only activePromos supplied activePromosToSave = activePromos; - inactivePromosToSave = removeCurrentlyActivePromoCodesFromInactivePromos(activePromosToSave, context.getters.payment.inactivePromos ?? []) + inactivePromosToSave = removeCurrentlyActivePromoCodesFromInactivePromos( + activePromosToSave, + context.getters.payment.inactivePromos ?? [] + ); } context.commit(storeMutations.UPDATE_PROMOS, activePromosToSave); context.commit(storeMutations.UPDATE_INACTIVE_PROMOS, inactivePromosToSave); @@ -2346,7 +2354,10 @@ export const actions = { lineItemsToUse.promos = activePromosToUse; inactivePromosToUse = inactivePromosToUse ?? order.payment.inactivePromos; - inactivePromosToUse = removeCurrentlyActivePromoCodesFromInactivePromos(lineItemsToUse.promos, inactivePromosToUse); + inactivePromosToUse = removeCurrentlyActivePromoCodesFromInactivePromos( + lineItemsToUse.promos, + inactivePromosToUse + ); let requestObject = { inactivePromos: inactivePromosToUse,