diff --git a/packages/server/src/utilities/csvParser.js b/packages/server/src/utilities/csvParser.js index 872ee5f8a4..aacb599676 100644 --- a/packages/server/src/utilities/csvParser.js +++ b/packages/server/src/utilities/csvParser.js @@ -7,6 +7,7 @@ const VALIDATORS = { } const PARSERS = { + number: attribute => Number(attribute), datetime: attribute => new Date(attribute).toISOString(), } @@ -24,7 +25,7 @@ function parse(path, parsers) { } } }) - result.fromFile(path).subscribe(row => { + result.subscribe((row, lineNumber) => { // For each CSV row parse all the columns that need parsed for (let key in parsers) { if (!schema[key] || schema[key].success) { diff --git a/packages/server/src/utilities/fileProcessor.js b/packages/server/src/utilities/fileProcessor.js index 3e580e9e37..4c219b758f 100644 --- a/packages/server/src/utilities/fileProcessor.js +++ b/packages/server/src/utilities/fileProcessor.js @@ -1,5 +1,5 @@ const fs = require("fs") -const sharp = require("sharp") +// const sharp = require("sharp") const fsPromises = fs.promises const FORMATS = { @@ -7,14 +7,14 @@ const FORMATS = { } async function processImage(file) { - const imgMeta = await sharp(file.path) - .resize(300) - .toFile(file.outputPath) + // const imgMeta = await sharp(file.path) + // .resize(300) + // .toFile(file.outputPath) - return { - ...file, - ...imgMeta, - } + // return { + // ...file, + // ...imgMeta, + // } } async function process(file) {