last day (17 days later) » 

8:54 AM
0
A: Passing extra values by POST to another function

Subhendu KunduTry sending all the data in one object await api.post('/fileUpload/group', { currentGroupId, formData, config }); Then get the data in uploadFile(req, res) { const postData = req.body;; This should fix the issue.

 
I tried but I got POST /api/v1/fileUpload/group 500 56.009 ms - 2320 TypeError: Cannot read property 'transfer-encoding' of undefined
 
router.post('/group', (req, res) => { this route and api.post('/fileUpload/group' are same?
 
Actually yes, because I have another file that prefix fileUpload to all my endpoints on this class, that's not the problem all data sends fine to my uploadFile function, the only problem is to sending an extra param in this case currentGroupId
 
Cool, await api.post('/fileUpload/group', { currentGroupId, formData }, config); I put the config in the data too. Try this now.
Also do a console.log(req.body)
 
Alright I got this: POST /api/v1/fileUpload/group - - ms - - REQ: {} Error: Multipart: Boundary not found at new Multipart (/home/maudev/Escritorio/daily-tracking/backend/node_modules‌​/busboy/lib/types/‌​mu‌​ltipart.js:58:11)
 
8:56 AM
Hey, the issue is with multer. Comment out all the code, just keep the console.log(req);
 

  last day (17 days later) »