Skip to content

Commit

Permalink
fixing merge-expenses
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Budhadev authored and Jay Budhadev committed Dec 12, 2023
1 parent aa0f170 commit 67b94d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/app/core/services/merge-expenses.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,10 @@ export class MergeExpensesService {
[fieldId: number]: Partial<CustomInput>[];
} {
const dependentFieldsMapping: DependentFieldsMapping = {};
expenses.forEach((expense) => {
expenses?.forEach((expense) => {
const txDependentFields: Partial<CustomInput>[] = dependentFields
?.map((dependentField: TxnCustomProperties) =>
expense.tx_custom_properties.find(
expense.tx_custom_properties?.find(
(txCustomProperty: Partial<CustomInput>) => dependentField.name === txCustomProperty.name
)
)
Expand Down
12 changes: 6 additions & 6 deletions src/app/fyle/merge-expense/merge-expense.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,6 @@ export class MergeExpensePage implements OnInit, AfterViewChecked {

this.systemCategories = this.categoriesService.getSystemCategories();

expenses$
.pipe(switchMap((expenses) => this.mergeExpensesService.generateReceiptOptions(expenses)))
.subscribe((receiptOptions) => {
this.receiptOptions = receiptOptions;
});

this.amountOptionsData$ = expenses$.pipe(
switchMap((expenses) => this.mergeExpensesService.generateAmountOptions(expenses))
);
Expand Down Expand Up @@ -320,6 +314,12 @@ export class MergeExpensePage implements OnInit, AfterViewChecked {
map((customProps) => (customProperties = customProps))
);

expenses$
.pipe(switchMap((expenses) => this.mergeExpensesService.generateReceiptOptions(expenses)))
.subscribe((receiptOptions) => {
this.receiptOptions = receiptOptions;
});

expenses$.subscribe((expenses) => (this.expenses = expenses));

this.combinedCustomProperties = this.generateCustomInputOptions(customProperties as Partial<CustomInput>[][]);
Expand Down

0 comments on commit 67b94d2

Please sign in to comment.