I have the same question as @GreenSaiko, but I also the following issues:
req.body
with new data. It is generally recommended that you don't modify that.req.body
is going to be undefined
.const mediaRouter = express.Router();
mediaRouter.use(express.json())
See express.json() documentation.
Additionally, if it IS undefined
, it's going to throw an error, and you're not going to catch it, because you don't have try/catch
anywhere around this line:
req.body.uploadedFile = uploadedFile;
So you could silently be throwing this error:
`Cannot set property of 'uploadedFile' of undefined`