Serviceability details update
Modify parameters needed for new endpoint functionality
This commit is contained in:
parent
24160e8b48
commit
ecfd8317d1
1 changed files with 8 additions and 16 deletions
|
|
@ -1341,27 +1341,19 @@ export const useMainStore = defineStore({
|
||||||
},
|
},
|
||||||
|
|
||||||
getServiceabilityDetails(serviceZipCode) {
|
getServiceabilityDetails(serviceZipCode) {
|
||||||
const { vehicle, damage, parentAccountNumber, referralSequenceNumber, lineItems } = this.order;
|
const { damage, parentAccountNumber, lineItems, vehicle } = this.order;
|
||||||
const { carId } = vehicle;
|
const { carId } = vehicle;
|
||||||
const glassArray = convertGlassPieceNamingForApi(damage.glassToReplace);
|
const flattenedGlassParts = getLineItemsFlattened(lineItems.glassParts);
|
||||||
const lineItemParts = [...(lineItems.glassParts || []), ...(lineItems.supportingItems || [])].map((part) => ({
|
const lineItemsList = flattenedGlassParts.map((part) => part.partNumber).join(',');
|
||||||
partNumber: part.partNumber,
|
|
||||||
recalibrationType: part.recalibrationType
|
|
||||||
}));
|
|
||||||
|
|
||||||
const params = buildURLSearchParams({
|
let endPoint = `${endpoints.GetServiceabilityDetails.url}?zip=${serviceZipCode}&carId=${carId}&parentAccountNumber=${parentAccountNumber}&isRepair=${damage.isRepair}`;
|
||||||
applicationName: applicationConfig.APPLICATION_NAME,
|
if (lineItemsList) {
|
||||||
parentAccountNumber,
|
endPoint += `&lineItems=${lineItemsList}`;
|
||||||
referralSequenceNumber,
|
}
|
||||||
zip: serviceZipCode,
|
|
||||||
carId,
|
|
||||||
glassPieces: glassArray,
|
|
||||||
lineItems: lineItemParts
|
|
||||||
});
|
|
||||||
|
|
||||||
return globalMethods.callHttpClient({
|
return globalMethods.callHttpClient({
|
||||||
method: endpoints.GetServiceabilityDetails.method,
|
method: endpoints.GetServiceabilityDetails.method,
|
||||||
endpoint: `${endpoints.GetServiceabilityDetails.url}?${params.toString()}`
|
endpoint: endPoint
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
lookupVehicleByVin(vin) {
|
lookupVehicleByVin(vin) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue