CSR-1452 | Formatting

This commit is contained in:
Scott Kiener 2023-11-13 14:07:10 -05:00
parent 0a9e59bf22
commit 7b7bd5da87
2 changed files with 20 additions and 6 deletions

View file

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

View file

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