Revert "Improving log messages"

This commit is contained in:
David Négrier 2021-11-24 16:20:07 +01:00 committed by GitHub
parent 6c5f330b71
commit 6e6cdc7bde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 203 additions and 581 deletions

View file

@ -2,7 +2,6 @@ import { createWriteStream } from "fs";
import { join, dirname } from "path";
import Busboy from "busboy";
import mkdirp from "mkdirp";
import log from "../../Services/Logger";
function formData(
contType: string,
@ -20,7 +19,7 @@ function formData(
filename?: (oldName: string) => string;
} = {}
) {
log.info("Enter form data");
console.log("Enter form data");
options.headers = {
"content-type": contType,
};
@ -48,10 +47,7 @@ function formData(
if (typeof options.tmpDir === "string") {
if (typeof options.filename === "function") filename = options.filename(filename);
const fileToSave = join(options.tmpDir, filename);
mkdirp(dirname(fileToSave)).then(
() => {},
() => {}
);
mkdirp(dirname(fileToSave));
file.pipe(createWriteStream(fileToSave));
value.filePath = fileToSave;