Fix to properly remove the home address option from the vehicle lookup

This commit is contained in:
Alex Humphries 2026-02-16 15:01:07 -05:00
parent ab04110cb9
commit c6a65c8d27

View file

@ -59,10 +59,14 @@ export default {
const isVinbyAddressPermissible = await this.getIsVinbyAddressPermissible(); const isVinbyAddressPermissible = await this.getIsVinbyAddressPermissible();
this.questionTextFromCms = this.getCmsContent(this.cmsWidgetName, 'QuestionText'); this.questionTextFromCms = this.getCmsContent(this.cmsWidgetName, 'QuestionText');
console.log(JSON.parse)
const answers = this.getCmsContent(this.cmsWidgetName, 'Answers'); const answers = this.getCmsContent(this.cmsWidgetName, 'Answers');
console.log(JSON.parse(JSON.stringify(answers)));
if (Array.isArray(answers)) { if (Array.isArray(answers)) {
if (!isVinbyAddressPermissible) { if (!isVinbyAddressPermissible) {
answers.splice(answers.indexOf(vinLookupMethodSelections.HOMEADDRESS), 1); const homeAddressIndex = answers.findIndex(answer => answer.Name === vinLookupMethodSelections.HOMEADDRESS);
answers.splice(homeAddressIndex, 1);
} }
this.answersFromCms = answers; this.answersFromCms = answers;
} }