Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
harshal015 committed Sep 23, 2024
1 parent 7f2cb0f commit 9a2ebce
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/app/fyle/add-edit-expense/add-edit-expense.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4525,15 +4525,30 @@ export class AddEditExpensePage implements OnInit {
}

if (!this.fg.controls.vendor_id.value && extractedData.vendor) {
this.txnFields$.subscribe((res) => {
res.vendor_id.options.map((merchant) => {
if (merchant.label.toLowerCase() === extractedData.vendor.toLowerCase()) {
this.txnFields$
.pipe(
map((res) => res.vendor_id.options),
filter((options) => !!options && options.length > 0),
map((options) =>
options.find(

Check failure on line 4533 in src/app/fyle/add-edit-expense/add-edit-expense.page.ts

View workflow job for this annotation

GitHub Actions / Run linters

Unsafe return of an `any` typed value
(merchant) =>
(typeof merchant === 'object' && merchant.label.toLowerCase()) ===

Check failure on line 4535 in src/app/fyle/add-edit-expense/add-edit-expense.page.ts

View workflow job for this annotation

GitHub Actions / Run linters

Unsafe member access .label on an `any` value

Check failure on line 4535 in src/app/fyle/add-edit-expense/add-edit-expense.page.ts

View workflow job for this annotation

GitHub Actions / Run linters

Unsafe call of an `any` typed value
extractedData.vendor.toLowerCase()
)
),
filter((merchant) => !!merchant)
)
.subscribe((merchant) => {
if (typeof merchant === 'object' && typeof merchant.value === 'object') {

Check failure on line 4542 in src/app/fyle/add-edit-expense/add-edit-expense.page.ts

View workflow job for this annotation

GitHub Actions / Run linters

Unsafe member access .value on an `any` value
this.fg.patchValue({
vendor_id: { display_name: merchant.value.display_name },

Check failure on line 4544 in src/app/fyle/add-edit-expense/add-edit-expense.page.ts

View workflow job for this annotation

GitHub Actions / Run linters

Unsafe assignment of an `any` value

Check failure on line 4544 in src/app/fyle/add-edit-expense/add-edit-expense.page.ts

View workflow job for this annotation

GitHub Actions / Run linters

Unsafe member access .value on an `any` value
});
} else {
this.fg.patchValue({
vendor_id: null,
});
}
});
});
}

// If category is auto-filled and there exists extracted category, priority is given to extracted category
Expand Down

0 comments on commit 9a2ebce

Please sign in to comment.