From 1c2c44132ebc914cb79acf798b79153e99faeba5 Mon Sep 17 00:00:00 2001 From: Sravan Gopathi Date: Tue, 9 May 2023 10:47:48 -0400 Subject: [PATCH] 1204: Payload changes --- .../service-location-helper.js | 2 +- src/layouts/service-location/service-location.spec.js | 1 - src/store/index.js | 11 ++++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js index 24be20fc8..157c28f2b 100644 --- a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js +++ b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.js @@ -35,7 +35,7 @@ export async function getServiceabilityDetails(serviceZipCode, lineItems) { storeActions.GET_SERVICEABILITY_DETAILS, { serviceZipCode: serviceZipCode, - lineItems: lineItems + lineItems: lineItems, }, false ); diff --git a/src/layouts/service-location/service-location.spec.js b/src/layouts/service-location/service-location.spec.js index dcb176919..52239462c 100644 --- a/src/layouts/service-location/service-location.spec.js +++ b/src/layouts/service-location/service-location.spec.js @@ -39,7 +39,6 @@ const mockGetServiceabilityDetails = (mockServiceZipCode) => { isRecalibrationServiceableInshop: true, isGlassServiceableMobile: true, isRecalibrationServiceableMobile: true, - IsServiceability:true, }; return Promise.resolve(serviceabilityDetails); diff --git a/src/store/index.js b/src/store/index.js index bad820b91..1548dd702 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -974,15 +974,20 @@ export const actions = { lineItemsWithOnlyPartNumbers, "lineItems" ); - const vehicle = context.getters.vehicle; + const vehicle = context.getters.vehicle; const carId = vehicle.carId; const damage = context.getters.damage; const glassArray = damage.glassToReplace; - // create a new array to avoid mutating state const glassArrayForPayload = convertGlassPieceNamingForApi(glassArray); return globalMethods.callHttpClient({ method: endpoints.GetServiceabilityDetails.method, - endpoint: `${endpoints.GetServiceabilityDetails.url}?zip=${serviceZipCode}&lineItems=${encodedLineItems}&carId=${carId}&glassPieces=${glassArrayForPayload}`, + endpoint: endpoints.GetServiceabilityDetails.url, + payload: { + zip: serviceZipCode, + lineItems: lineItemsToSend, + carId: carId, + glassPieces: glassArrayForPayload, + }, }); },