diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index cfcd501c..c55410da 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -139,7 +139,7 @@ const endpoints = Object.freeze({ }, TaxOrderItems: { url: `${PRICE_BASE_URL}/taxed-order-items`, - method: 'GET' + method: 'POST' }, LogExperimentExposureIfAssigned: { url: `${EXPERIMENTS_BASE_URL}/log-exposure`, diff --git a/src/store/index.js b/src/store/index.js index 731efee1..1d6e44b7 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2365,38 +2365,27 @@ export const useMainStore = defineStore({ const serviceLocationCity = serviceLocation.city; const serviceLocationState = serviceLocation.state; const serviceLocationZipCode = serviceLocation.zipCode; - - const lineItemsQueryString = getTaxLineItemQueryString(pricedLineItems, 'lineItems'); - - let queryString = ''; - if (appointmentType === AppointmentTypeStrings.MOBILE - || appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP) { - queryString = - `ParentAccountNumber=${this.order.parentAccountNumber}` - + `&BillToAccountNumber=${this.billToAccountNumber}` - + `&ProviderNumber=${this.providerNumber}` - + `&AppointmentType=${appointmentType}` - + `&ServiceLocation.City=${serviceLocationCity}` - + `&ServiceLocation.State=${serviceLocationState}` - + `&ServiceLocation.ZipCode=${serviceLocationZipCode}` - + `${lineItemsQueryString}`; - } else { - queryString = - `ParentAccountNumber=${this.order.parentAccountNumber}` - + `&BillToAccountNumber=${this.billToAccountNumber}` - + `&ProviderNumber=${this.providerNumber}` - + `&AppointmentType=${appointmentType}` - + `${lineItemsQueryString}`; - } - const lineItemServerData = this.order.lineItems.serverData; - if (lineItemServerData) { - queryString += `&ServerData=${encodeURIComponent(lineItemServerData)}`; - } + const isMobileApt = appointmentType === AppointmentTypeStrings.MOBILE + || appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP; + const retPricedLineItems = await globalMethods.callHttpClient({ method: endpoints.TaxOrderItems.method, - endpoint: `${endpoints.TaxOrderItems.url}?${queryString}` + endpoint: endpoints.TaxOrderItems.url, + payload: { + ParentAccountNumber: this.order.parentAccountNumber, + BillToAccountNumber: this.billToAccountNumber, + ProviderNumber: this.providerNumber, + AppointmentType: appointmentType, + PricedLineItems: getLineItemsFlattened(pricedLineItems), + ServiceLocation: { + City: isMobileApt ? serviceLocationCity : null, + State: isMobileApt ? serviceLocationState : null, + ZipCode: isMobileApt ? serviceLocationZipCode : null, + }, + ServerData: lineItemServerData ? lineItemServerData : "", + }, }).then((response) => { this.order.lineItems.serverData = response.data.serverData; return addTaxesToPricedLineItems(pricedLineItems, response.data.taxedLineItems);