79213399

Date: 2024-11-22 01:48:27
Score: 2.5
Natty:
Report link

I have the same question as @GreenSaiko, but I also the following issues:

  1. I see you're overwriting req.body with new data. It is generally recommended that you don't modify that.
  2. If this is all of your backend router, you're not using any kind of body parsing, so 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`
Reasons:
  • Blacklisted phrase (1): I have the same question
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): I have the same question
  • User mentioned (1): @GreenSaiko
  • High reputation (-1):
Posted by: Dan Crews