Simplifying

This commit is contained in:
Michaela Brydon 2024-01-22 16:18:44 -05:00
parent a84c0081c8
commit 503ac4e1c6

View file

@ -23,7 +23,7 @@ export default {
computed: { computed: {
displayContent() { displayContent() {
const { glassToReplace, isRepair } = useMainStore().order.damage; const { glassToReplace, isRepair } = useMainStore().order.damage;
return this.getDamageDisplayContent( return getDamageDisplayContent(
this.locationAnswers, this.locationAnswers,
this.driverSideDamageAnswers, this.driverSideDamageAnswers,
this.passengerSideDamageAnswers, this.passengerSideDamageAnswers,
@ -32,11 +32,11 @@ export default {
); );
}, },
driverSideDamageAnswers() { driverSideDamageAnswers() {
const answerContent = this.getLocationAnswer(damageLocationsSelected.DRIVER, this.locationAnswers); const answerContent = getLocationAnswer(damageLocationsSelected.DRIVER, this.locationAnswers);
return this.getAnswersNullSafe(answerContent?.SubWidgetName); return this.getAnswersNullSafe(answerContent?.SubWidgetName);
}, },
passengerSideDamageAnswers() { passengerSideDamageAnswers() {
const answerContent = this.getLocationAnswer(damageLocationsSelected.PASSENGER, this.locationAnswers); const answerContent = getLocationAnswer(damageLocationsSelected.PASSENGER, this.locationAnswers);
return this.getAnswersNullSafe(answerContent?.SubWidgetName); return this.getAnswersNullSafe(answerContent?.SubWidgetName);
}, },
locationAnswers() { locationAnswers() {
@ -47,9 +47,7 @@ export default {
getAnswersNullSafe(widgetName) { getAnswersNullSafe(widgetName) {
const rawAnswers = this.getCmsContent(widgetName, 'Answers'); const rawAnswers = this.getCmsContent(widgetName, 'Answers');
return rawAnswers || []; return rawAnswers || [];
}, }
getDamageDisplayContent,
getLocationAnswer
} }
}; };
</script> </script>