update API request

This commit is contained in:
Katie Kroell 2023-10-31 14:15:45 -04:00
parent 5f8737a4e0
commit 985ba28f71

View file

@ -517,20 +517,43 @@ export const useMainStore = defineStore({
}
});
}
const orderItemsArray = [];
const manuaGlassNamesArray = [];
const glassInformation = this.order.damage.glassToReplace;
glassInformation.forEach((glassPiece) => {
const glassPieceObject = {
name: glassPiece.glassLocation
};
orderItemsArray.push(glassPieceObject);
manuaGlassNamesArray.push(glassPiece.glassLocation);
});
return new Promise((resolve, reject) => {
globalMethods.callHttpClient({
method: endpoints.FinalDeductible.method,
endpoint: endpoints.FinalDeductible.url,
payload: {
referralCorrelationId: this.order.referralCorrelationId,
referralNumber: this.order.referralNumber,
accountNumber: this.issConfig.parentAccountNumber?.toString() ?? '',
currentDeductible: this.order.currentDeductible,
noCoverage: this.order.policy.noCoverage,
endorsements: endorsementAnswersForPayload,
insured: {
address: {
state: this.order.customer.address.state
}
},
lossInfo: {
vehicle: {
endorsements: endorsementAnswersForPayload
},
manualGlassNames: manuaGlassNamesArray
},
policy: {
status: 'Active', // change to this.order.policy.status after changing back end request
policyState: this.order.vehicle.registration.state
}
policyState: this.order.customer.address.state,
status: this.order.policy.status,
currentDeductible: this.order.currentDeductible,
noCoverage: this.order.policy.noCoverage
},
orderItems: orderItemsArray
}
}).then((r) => {
this.updateDeductible(r.data);