Skip to content

Commit

Permalink
fix: dynamic root model name
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeen committed Jan 23, 2022
1 parent 4b41d5e commit 0423b0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/xls.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const createXlsFromSequelizeResults = (rows, model, hex = false, csv = fa
for (const [_i, assocColVal] of columnValue.entries()) {
const xlsRow = [];
if (!Object.keys(sheets).includes(associatedModel)) {
sheets[associatedModel] = { name: associatedModel, data: [Object.keys(assocColVal).concat(['projectId'])], };
sheets[associatedModel] = { name: associatedModel, data: [Object.keys(assocColVal).concat([row[model.name + 'Id']])], };
}
for (const v of Object.values(assocColVal).map(col => col === null ? 'null': col)) {
xlsRow.push(encodeValue(v, hex));
Expand Down

0 comments on commit 0423b0d

Please sign in to comment.