CSR-1977: ensures promo codes are in ALL CAPS even if they are returned from API call that way
This commit is contained in:
parent
a4a505ba43
commit
99152df219
1 changed files with 7 additions and 2 deletions
|
|
@ -199,9 +199,14 @@ export default {
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// ensure that all promo codes that return are in all caps format
|
||||||
|
promoValidationResponse?.orderPromos?.forEach((orderPromo) => {
|
||||||
|
orderPromo.promoCode = orderPromo.promoCode.toUpperCase();
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isValid: !("errorCode" in promoValidationResponse),
|
isValid: !("errorCode" in promoValidationResponse),
|
||||||
promoCode: promoValidationResponse?.orderPromos,
|
promoCode: promoValidationResponse?.orderPromos, // should be an array of promos
|
||||||
errorCode: promoValidationResponse?.errorCode,
|
errorCode: promoValidationResponse?.errorCode,
|
||||||
additionalInfo: promoValidationResponse?.additionalInfo,
|
additionalInfo: promoValidationResponse?.additionalInfo,
|
||||||
};
|
};
|
||||||
|
|
@ -264,7 +269,7 @@ export default {
|
||||||
if (promoCodeData.isValid) {
|
if (promoCodeData.isValid) {
|
||||||
if (this.taxPromos) {
|
if (this.taxPromos) {
|
||||||
const pricedLineItemsToTax = [];
|
const pricedLineItemsToTax = [];
|
||||||
pricedLineItemsToTax.push(...promoCodeData.promoCode);
|
pricedLineItemsToTax.push(...promoCodeData.promoCode); // promoCodeData.promoCode should be an array
|
||||||
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,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue