1204: Payload changes

This commit is contained in:
Sravan Gopathi 2023-05-09 10:47:48 -04:00
parent 1f2ead4579
commit 1c2c44132e
3 changed files with 9 additions and 5 deletions

View file

@ -35,7 +35,7 @@ export async function getServiceabilityDetails(serviceZipCode, lineItems) {
storeActions.GET_SERVICEABILITY_DETAILS,
{
serviceZipCode: serviceZipCode,
lineItems: lineItems
lineItems: lineItems,
},
false
);

View file

@ -39,7 +39,6 @@ const mockGetServiceabilityDetails = (mockServiceZipCode) => {
isRecalibrationServiceableInshop: true,
isGlassServiceableMobile: true,
isRecalibrationServiceableMobile: true,
IsServiceability:true,
};
return Promise.resolve(serviceabilityDetails);

View file

@ -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,
},
});
},