From b21e9dc8d242107a8e475379f4396470953e7a58 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Tue, 31 Oct 2023 10:26:08 -0400 Subject: [PATCH] Added conditional to only send service location city, state, and zipcode to the backend if the appointment type is Mobile --- src/store/index.js | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 1516faca1..62caaa1d1 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2196,15 +2196,25 @@ export const actions = { "lineItems" ); - let queryString = - `ParentAccountNumber=${applicationConfig.CASH_PARENT_ACCOUNT_NUMBER}` + - `&BillToAccountNumber=${billToAccountNumber}` + - `&ProviderNumber=${providerNumber}` + - `&AppointmentType=${appointmentType}` + - `&ServiceLocation.City=${serviceLocationCity}` + - `&ServiceLocation.State=${serviceLocationState}` + - `&ServiceLocation.ZipCode=${serviceLocationZipCode}` + - `&${pricedLineItemsFormattedForRequest}`; + let queryString = ""; + if (appointmentType == "Mobile") { + queryString = + `ParentAccountNumber=${applicationConfig.CASH_PARENT_ACCOUNT_NUMBER}` + + `&BillToAccountNumber=${billToAccountNumber}` + + `&ProviderNumber=${providerNumber}` + + `&AppointmentType=${appointmentType}` + + `&ServiceLocation.City=${serviceLocationCity}` + + `&ServiceLocation.State=${serviceLocationState}` + + `&ServiceLocation.ZipCode=${serviceLocationZipCode}` + + `&${pricedLineItemsFormattedForRequest}`; + } else { + queryString = + `ParentAccountNumber=${applicationConfig.CASH_PARENT_ACCOUNT_NUMBER}` + + `&BillToAccountNumber=${billToAccountNumber}` + + `&ProviderNumber=${providerNumber}` + + `&AppointmentType=${appointmentType}` + + `&${pricedLineItemsFormattedForRequest}`; + } const lineItemServerData = context.getters.order.lineItems.serverData; if (lineItemServerData) {