Fix to properly remove the home address option from the vehicle lookup
This commit is contained in:
parent
ab04110cb9
commit
c6a65c8d27
1 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue