From d9c3fb55f4a26b27db9682732f8f9a129db4be83 Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Fri, 14 May 2021 20:33:20 +0200 Subject: [PATCH] Clean up code --- .../transactions-table.component.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/client/src/app/components/transactions-table/transactions-table.component.ts b/apps/client/src/app/components/transactions-table/transactions-table.component.ts index cf145d9cf..0d2583efe 100644 --- a/apps/client/src/app/components/transactions-table/transactions-table.component.ts +++ b/apps/client/src/app/components/transactions-table/transactions-table.component.ts @@ -249,15 +249,20 @@ export class TransactionsTableComponent private getSearchableFieldValues(transactions: OrderWithAccount[]): string[] { const fieldValues = new Set(); + for (const transaction of transactions) { this.getFilterableValues(transaction, fieldValues); } - return [...fieldValues].filter((item) => item !== undefined).sort(); + return [...fieldValues] + .filter((item) => { + return item !== undefined; + }) + .sort(); } private getFilterableValues( - transaction, + transaction: OrderWithAccount, fieldValues: Set = new Set() ): string[] { fieldValues.add(transaction.currency); @@ -265,6 +270,9 @@ export class TransactionsTableComponent fieldValues.add(transaction.type); fieldValues.add(transaction.Account?.name); fieldValues.add(transaction.Account?.Platform?.name); - return [...fieldValues].filter((item) => item !== undefined); + + return [...fieldValues].filter((item) => { + return item !== undefined; + }); } }