42 lines
No EOL
1.5 KiB
JavaScript
42 lines
No EOL
1.5 KiB
JavaScript
|
|
/**
|
|
* Given a part and a capabilityAnswerResult, returns the same part but with update
|
|
* recalibrationType and requiresRecalibration values based on the capabilityAnswerResult
|
|
* @param {*} part
|
|
* @param {*} capabilityAnswerResult
|
|
* @returns part
|
|
*/
|
|
function setPartRecalibrationProperties(part, capabilityAnswerResult) {
|
|
part.RecalibrationType = capabilityAnswerResult.Result1;
|
|
part.RequiresRecalibration = capabilityAnswerResult.Result2 != "0";
|
|
return part;
|
|
}
|
|
|
|
// function x(capabilityQuestionAnswers, glassLocation) {
|
|
|
|
// }
|
|
|
|
// setAllPartRecalibrationProperties(parts, context, { payload, pageNameToLog }) {
|
|
// const glassLocation = payload;
|
|
// const pageData = context.getters.pageData(fmgPageValues.CAPABILITY_QUESTIONS);
|
|
|
|
// const part = pageData.partsOrQuestions.find((x) => x.glassLocation === glassLocation)
|
|
// .parts[0];
|
|
// const capabilityQuestionAnswers = context.getters.damage.capabilityQuestionAnswers;
|
|
// const capabilityQuestionAnswersForPart = capabilityQuestionAnswers.find(
|
|
// (x) => x.glassLocation === glassLocation
|
|
// );
|
|
|
|
// return globalMethods.callHttpClient({
|
|
// method: endpoints.GetPartFromCapabilityAnswer.method,
|
|
// endpoint: endpoints.GetPartFromCapabilityAnswer.url,
|
|
// payload: {
|
|
// part,
|
|
// capabilityAnswerResults: capabilityQuestionAnswersForPart,
|
|
// },
|
|
// logApiCall: true,
|
|
// pageNameToLog: pageNameToLog,
|
|
// });
|
|
// },
|
|
|
|
export default setPartRecalibrationProperties; |