Skip to content

Commit

Permalink
Bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
NotTimTam committed Sep 13, 2024
1 parent 2a0a9a5 commit e396689
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions controllers/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const convert = async (req, res) => {
.send("No 'files' field provided in request FormData.")
);

const {
let {
files: { files }, // Multer stores all file fields in a "files" object, which is what cause the nesting.
} = req;

Expand Down Expand Up @@ -76,6 +76,8 @@ export const convert = async (req, res) => {
)
);

files = fileConverter.__transformFiles(files);

for (const { mimetype } of files)
if (!moduleObject.convertsFrom(mimetype))
return await unlinkAndGo(req.files, () =>
Expand Down Expand Up @@ -141,11 +143,7 @@ export const convert = async (req, res) => {
}
}

const job = fileConverter.createJob(
fileConverter.__transformFiles(files),
moduleObject,
parsedOptions
);
const job = fileConverter.createJob(files, moduleObject, parsedOptions);

res.status(200).send({ jobId: job._id });

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nottimtam/file-converter",
"version": "1.2.17",
"version": "1.2.18",
"description": "A headless, self-hostable, open-source file conversion express middleware.",
"main": "index.js",
"type": "module",
Expand Down

0 comments on commit e396689

Please sign in to comment.