Merge pull request #2269 from Safelite/feature/CASH-48-bug

CASH-48
This commit is contained in:
AdamCaouetteSafelite 2025-02-02 20:04:22 -05:00 committed by GitHub
commit 9f97488f24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 27 deletions

View file

@ -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: {

View file

@ -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