diff --git a/src/controllers/project.controller.js b/src/controllers/project.controller.js index a312ba81..b25b55bf 100644 --- a/src/controllers/project.controller.js +++ b/src/controllers/project.controller.js @@ -26,7 +26,7 @@ import { } from '../utils/data-assertions'; import { createProjectRecordsFromCsv } from '../utils/csv-utils'; -import {createXlsFromSequelizeResults, sendXls} from '../utils/xls'; +import { createXlsFromSequelizeResults, sendXls } from '../utils/xls'; import * as stream from "stream"; export const create = async (req, res) => { diff --git a/src/controllers/units.controller.js b/src/controllers/units.controller.js index d2a38959..7608f8af 100644 --- a/src/controllers/units.controller.js +++ b/src/controllers/units.controller.js @@ -21,7 +21,7 @@ import { } from '../utils/data-assertions'; import { createUnitRecordsFromCsv } from '../utils/csv-utils'; -import {createXlsFromSequelizeResults} from "../utils/xls.js"; +import { createXlsFromSequelizeResults, sendXls } from "../utils/xls"; export const create = async (req, res) => { try { @@ -146,7 +146,7 @@ export const findAll = async (req, res) => { if (!xls) { return res.json(response); } else { - createXlsFromSequelizeResults(response, Unit); + return sendXls(Unit.name, createXlsFromSequelizeResults(response, Unit), res); } };