Skip to content

Commit

Permalink
fix: populate issuanceId properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeen committed Jan 31, 2022
1 parent ff50d8e commit 3d2bd5b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/utils/xls.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const createXlsFromSequelizeResults = (
data: [
columnsInMainSheet.filter((colName) => {
return !(excludeOrgUid && colName === 'orgUid');
}),
}).map(colName => colName === 'issuance' ? 'issuanceId' : colName), // todo make this generic
],
};

Expand Down Expand Up @@ -183,6 +183,13 @@ export const createXlsFromSequelizeResults = (
}
}
}
} else {
if (columnName === 'issuanceId') {
const lastRow = sheets[model.name].data.pop();
lastRow.pop();
lastRow.push(columnValue);
sheets[model.name].data.push(lastRow);
}
}
}
}
Expand Down Expand Up @@ -352,6 +359,8 @@ export const updateTableWithData = async (tableData, model) => {
}

if (!validation.error) {
console.log(JSON.stringify(row))
console.log("WEFwefs")
await Staging.upsert({
uuid: data[model.primaryKeyAttributes[0]],
action: exists ? 'UPDATE' : 'INSERT',
Expand Down

0 comments on commit 3d2bd5b

Please sign in to comment.