Skip to content

Commit af8e930

Browse files
authored
Merge pull request #91936 from Expensify/alberto-passHeader
[Payment due @huult] Pass header to backend when importing CSV company cards
2 parents 7ff81e1 + 5f37c97 commit af8e930

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/pages/workspace/companyCards/addNew/CompanyCardsImportedPage.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ function CompanyCardsImportedPage({route}: CompanyCardsImportedPageProps) {
124124
const columns = spreadsheet?.data ?? [];
125125
const rows: string[][] = [];
126126
if (columns.length > 0) {
127-
const startRowIndex = spreadsheet?.containsHeader ? 1 : 0;
128-
for (let rowIndex = startRowIndex; rowIndex < (columns.at(0)?.length ?? 0); rowIndex++) {
127+
if (!spreadsheet?.containsHeader) {
128+
rows.push(columnMappings);
129+
}
130+
for (let rowIndex = 0; rowIndex < (columns.at(0)?.length ?? 0); rowIndex++) {
129131
const row: string[] = [];
130132
for (const column of columns) {
131133
row.push(column.at(rowIndex) ?? '');

0 commit comments

Comments
 (0)