From 8d704fdc97b00b81adf4c7264725fc6e0dfaee67 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Sat, 10 Jan 2026 15:25:14 -0500 Subject: [PATCH] CASH-1952 CASH-1952 endpoint for tax changed to POST from GET --- src/constants/endpoints.js | 2 +- src/store/index.js | 45 ++++++++++++++------------------------ 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index 055b56b4..c7dbc97f 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 e3555edb..53ec7479 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: pricedLineItems, + serviceLocation: { + city: isMobileApt ? serviceLocationCity : null, + state: isMobileApt ? serviceLocationState : null, + zipCode: isMobileApt ? serviceLocationZipCode : null, + }, + serverData: lineItemServerData ? encodeURIComponent(lineItemServerData) : "", + }, }).then((response) => { this.order.lineItems.serverData = response.data.serverData; return addTaxesToPricedLineItems(pricedLineItems, response.data.taxedLineItems);