From ed2adf208d197f891cfec7c4fdb47b6e3915e91b Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 3 Apr 2024 14:49:55 -0400 Subject: [PATCH 1/2] WIP --- .../insurance-company-question.vue | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/layouts/insurance-company/insurance-company-question.vue b/src/layouts/insurance-company/insurance-company-question.vue index b69a77d49..ad0e12766 100644 --- a/src/layouts/insurance-company/insurance-company-question.vue +++ b/src/layouts/insurance-company/insurance-company-question.vue @@ -79,6 +79,18 @@ export default { }, }, methods: { + getParentAccountNumber(parentAccountName) { + const matchedItem = this.searchableInsuranceCompanyList?.filter((item) => { + return item.accountName === parentAccountName; + }); + + if (matchedItem) { + return matchedItem[0].parentAccountNumber; + } else { + console.error("Error locating " + parentAccountName); + return; + } + }, findMatches(request, response) { const matches = []; const term = request?.term?.toUpperCase(); @@ -98,16 +110,20 @@ export default { return; } - const selectedItem = this.searchableInsuranceCompanyList.filter((item) => { - return item.accountName === parentAccountName; - }); + // const selectedItem = this.searchableInsuranceCompanyList.filter((item) => { + // return item.accountName === parentAccountName; + // }); - if (selectedItem) { - this.selectedAccountName = parentAccountName; - this.selectedAccountNumber = selectedItem[0].parentAccountNumber; - } else { - console.error("Error locating " + parentAccountName); - } + this.selectedAccountNumber = this.getParentAccountNumber(parentAccountName); + + // if (selectedItem) { + // this.selectedAccountName = parentAccountName; + // //this.selectedAccountNumber = selectedItem[0].parentAccountNumber; + // console.log("this.selectedAccountNumber", selectedItem[0].parentAccountNumber); + // console.log("this.getParentAccountNumber", this.getParentAccountNumber(parentAccountName)); + // } else { + // console.error("Error locating " + parentAccountName); + // } }, }, mounted() { From fce292bb20c661f75f2c82e5f24685024657f3cd Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 3 Apr 2024 18:11:33 -0400 Subject: [PATCH 2/2] CSR-1996: bug fixes and refactoring --- .../insurance-company-question.vue | 67 +++++++++---------- .../insurance-company/insurance-company.vue | 13 ++-- src/store/index.js | 2 +- 3 files changed, 40 insertions(+), 42 deletions(-) diff --git a/src/layouts/insurance-company/insurance-company-question.vue b/src/layouts/insurance-company/insurance-company-question.vue index ad0e12766..49e1eb8c8 100644 --- a/src/layouts/insurance-company/insurance-company-question.vue +++ b/src/layouts/insurance-company/insurance-company-question.vue @@ -1,6 +1,6 @@