Skip to content

Commit 300be0a

Browse files
committed
use constants
1 parent 0c0ec73 commit 300be0a

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/CONST/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8002,6 +8002,8 @@ const CONST = {
80028002
IGNORE: 'ignore',
80038003
DESTINATION: 'destination',
80048004
CATEGORY: 'category',
8005+
DATE: 'date',
8006+
MERCHANT: 'merchant',
80058007
TRANSACTION_FIELDS: ['date', 'merchant', 'amount', 'category'] as const,
80068008
},
80078009

src/components/ImportColumn.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ function findColumnName(header: string): string {
106106
case 'date':
107107
case 'transactiondate':
108108
case 'transaction_date':
109-
attribute = 'date';
109+
attribute = CONST.CSV_IMPORT_COLUMNS.DATE;
110110
break;
111111

112112
case 'merchant':
113113
case 'merchants':
114114
case 'vendor':
115115
case 'vendors':
116-
attribute = 'merchant';
116+
attribute = CONST.CSV_IMPORT_COLUMNS.MERCHANT;
117117
break;
118118

119119
case 'rateid':

src/pages/settings/Wallet/TransactionsImportedPage.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ function TransactionsImportedPage({route}: TransactionsImportedPageProps) {
6464
const columnRoles: ColumnRole[] = useMemo(
6565
() => [
6666
{text: translate('common.ignore'), value: CONST.CSV_IMPORT_COLUMNS.IGNORE},
67-
{text: translate('common.date'), value: 'date', isRequired: true},
68-
{text: translate('common.merchant'), value: 'merchant', isRequired: true},
69-
{text: translate('common.category'), value: 'category'},
70-
{text: translate('iou.amount'), value: 'amount', isRequired: true},
67+
{text: translate('common.date'), value: CONST.CSV_IMPORT_COLUMNS.DATE, isRequired: true},
68+
{text: translate('common.merchant'), value: CONST.CSV_IMPORT_COLUMNS.MERCHANT, isRequired: true},
69+
{text: translate('common.category'), value: CONST.CSV_IMPORT_COLUMNS.CATEGORY},
70+
{text: translate('iou.amount'), value: CONST.CSV_IMPORT_COLUMNS.AMOUNT, isRequired: true},
7171
],
7272
[translate],
7373
);

0 commit comments

Comments
 (0)