diff --git a/src/utils/xls.js b/src/utils/xls.js index ecfbdacd..169d1116 100644 --- a/src/utils/xls.js +++ b/src/utils/xls.js @@ -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 ], }; @@ -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); + } } } } @@ -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',