Skip to content

Commit

Permalink
fix: fixed duplicate calls for reports (#3055)
Browse files Browse the repository at this point in the history
  • Loading branch information
devendrafyle authored Jun 7, 2024
1 parent 75e3a03 commit 4e453bc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
10 changes: 3 additions & 7 deletions src/app/fyle/add-edit-expense/add-edit-expense.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3176,13 +3176,9 @@ export class AddEditExpensePage implements OnInit {
map((reports) =>
reports.filter((report) => !report.approvals.some((approval) => approval.state === 'APPROVAL_DONE'))
),
map((reports: Report[]) => reports.map((report) => ({ label: report.purpose, value: report })))
) as Observable<
{
label: string;
value: Report;
}[]
>;
map((reports: Report[]) => reports.map((report) => ({ label: report.purpose, value: report }))),
shareReplay(1)
);

this.recentlyUsedCategories$ = forkJoin({
filteredCategories: this.filteredCategories$.pipe(take(1)),
Expand Down
10 changes: 3 additions & 7 deletions src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1648,13 +1648,9 @@ export class AddEditMileagePage implements OnInit {
map((reports) =>
reports.filter((report) => !report.approvals.some((approval) => approval.state === 'APPROVAL_DONE'))
),
map((reports: Report[]) => reports.map((report) => ({ label: report.purpose, value: report })))
) as Observable<
{
label: string;
value: Report;
}[]
>;
map((reports: Report[]) => reports.map((report) => ({ label: report.purpose, value: report }))),
shareReplay(1)
);

this.setupTxnFields();

Expand Down
11 changes: 3 additions & 8 deletions src/app/fyle/add-edit-per-diem/add-edit-per-diem.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ import { ExtendedAccount } from 'src/app/core/models/extended-account.model';
import { OutboxQueue } from 'src/app/core/models/outbox-queue.model';
import { AllowedPerDiemRateOptions } from 'src/app/core/models/allowed-per-diem-rate-options.model';
import { PerDiemReports } from 'src/app/core/models/per-diem-reports.model';
import { Report } from 'src/app/core/models/platform/v1/report.model';
import { TransactionState } from 'src/app/core/models/transaction-state.enum';
import { ToastType } from 'src/app/core/enums/toast-type.enum';
import { Expense } from 'src/app/core/models/expense.model';
Expand Down Expand Up @@ -1092,13 +1091,9 @@ export class AddEditPerDiemPage implements OnInit {
reports
.filter((report) => !report.approvals.some((approval) => approval.state === 'APPROVAL_DONE'))
.map((report) => ({ label: report.purpose, value: report }))
)
) as Observable<
{
label: string;
value: Report;
}[]
>;
),
shareReplay(1)
);

this.txnFields$
.pipe(
Expand Down

0 comments on commit 4e453bc

Please sign in to comment.