commit
9f97488f24
2 changed files with 27 additions and 27 deletions
|
|
@ -125,7 +125,7 @@ const endpoints = {
|
|||
method: "POST",
|
||||
},
|
||||
SaveQuote: {
|
||||
url: "/order/api/v1/order/initiate-saved-progress-email",
|
||||
url: "/order/api/v1/order/save-progress",
|
||||
method: "POST",
|
||||
},
|
||||
GetSignature: {
|
||||
|
|
|
|||
|
|
@ -116,40 +116,40 @@ export default {
|
|||
|
||||
// send part question data to SPS API for logging
|
||||
const orderFromStore = await deepClone(store.getters.order);
|
||||
const applicationUserFromStore = await deepClone(store.getters.applicationUser);
|
||||
const ctu = orderFromStore.workOrderNumber?.split("-")[0];
|
||||
const partsOrQuestions = applicationUserFromStore.pageData["part-questions"].partsOrQuestions;
|
||||
const onlyPartsWithQuestions = partsOrQuestions.filter((part) => {
|
||||
return part.partQuestions?.length > 0;
|
||||
});
|
||||
const ctu = orderFromStore.serviceLocation?.zipCodeCtu
|
||||
|
||||
onlyPartsWithQuestions.forEach(part => {
|
||||
const partsOrQuestions = orderFromStore.damage?.partQuestionAnswers;
|
||||
|
||||
partsOrQuestions.forEach(pqa => {
|
||||
const payloadPartQuestions = [];
|
||||
part.partQuestions.forEach(question => {
|
||||
pqa.answeredQuestions.forEach(answer => {
|
||||
payloadPartQuestions.push({
|
||||
questionSeq: question.questionSequence,
|
||||
questionText: question.questionText,
|
||||
answerText: question.answerSelected.split("|")[3],
|
||||
basePart: question.answerSelected.split("|")[2],
|
||||
questionSeq: answer?.questionNum,
|
||||
questionText: answer?.questionText,
|
||||
answerText: answer?.selectedAnswerText,
|
||||
basePart: pqa?.result,
|
||||
});
|
||||
});
|
||||
const payload = {
|
||||
eon: orderFromStore.eon,
|
||||
ctu: ctu,
|
||||
workOrderId: orderFromStore.workOrderId,
|
||||
workOrderNumber: orderFromStore.workOrderNumber,
|
||||
carId: orderFromStore.vehicle.carId,
|
||||
glassLocation: part.glassLocation,
|
||||
partQuestions: payloadPartQuestions,
|
||||
};
|
||||
|
||||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.LOG_PART_QUESTIONS,
|
||||
payload,
|
||||
false
|
||||
);
|
||||
const payload = {
|
||||
eon: orderFromStore.eon,
|
||||
ctu: ctu,
|
||||
workOrderId: orderFromStore.workOrderId,
|
||||
workOrderNumber: orderFromStore.workOrderNumber,
|
||||
carId: orderFromStore.vehicle.carId,
|
||||
glassLocation: pqa?.glassLocation,
|
||||
partQuestions: payloadPartQuestions,
|
||||
};
|
||||
|
||||
baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.LOG_PART_QUESTIONS,
|
||||
payload,
|
||||
false
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Create order
|
||||
await baseMixin.methods.dispatchStoreAction(storeActions.CREATE_SUBMITTED_ORDER); // This nulls the Store order
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue