Fixed up updateMetadata

This commit is contained in:
Saud Fatayerji
2023-11-11 20:27:28 +03:00
parent fd6b0740fd
commit 1b0a881ad6
2 changed files with 47 additions and 33 deletions

View File

@@ -40,7 +40,7 @@ router.post('/update-metadata', upload.single("pdfFile"), async function(req: Re
title: Joi.string(),
trapped: Joi.string(),
allRequestParams: Joi.object().pattern(Joi.string(), Joi.string()),
});
}).required();
const { error, value } = schema.validate(req.body);
if (error) {
res.status(400).send(error.details);
@@ -51,7 +51,7 @@ router.post('/update-metadata', upload.single("pdfFile"), async function(req: Re
return;
}
const processed = await Operations.updateMetadata(req.file.buffer, value.angle)
const processed = await Operations.updateMetadata(req.file.buffer, value)
const newFilename = appendToFilename(req.file.originalname, '_edited-metadata');
respondWithBinaryPdf(res, processed, newFilename);
});