From 60a9716a649b214ed74b01af2f2d4c2190960a3c Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Sun, 19 Dec 2021 11:33:06 +0100 Subject: [PATCH] Refactoring --- .../app/services/import-transactions.service.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/client/src/app/services/import-transactions.service.ts b/apps/client/src/app/services/import-transactions.service.ts index 55a5522bb..d3baa13a4 100644 --- a/apps/client/src/app/services/import-transactions.service.ts +++ b/apps/client/src/app/services/import-transactions.service.ts @@ -214,12 +214,15 @@ export class ImportTransactionsService { for (const key of ImportTransactionsService.TYPE_KEYS) { if (item[key]) { - if (item[key].toLowerCase() === 'buy') { - return Type.BUY; - } else if (item[key].toLowerCase() === 'sell') { - return Type.SELL; - } else if (item[key].toLowerCase() === 'dividend') { - return Type.DIVIDEND; + switch (item[key].toLowerCase()) { + case 'buy': + return Type.BUY; + case 'dividend': + return Type.DIVIDEND; + case 'sell': + return Type.SELL; + default: + break; } } }