axios.put('http://localhost:3000/api/userDatas/findUserAddProp',{
params: {
userId: "5bb8c3bd16bf1f515ce5b42f",
prop: "questions",
questionId: "5bb8c466cb49d8421c05eeda"
}
});
Server
Userdatas.findUserAddProp = function(req, res, cb) {
const queryId = req.query.userId;
const propToUpdate = req.query.prop;
const questionId = req.query.questionId;
console.log("queryId: ", queryId);
console.log("propToUpdate: ", propToUpdate);
console.log("questionId: ", questionId);
...
}
Here is the the server output on the console.
queryId: undefined
propToUpdate: undefined
questionId: undefined
Why is that happening i just passed all params to the server?
console.log(req.body)
– Theatricals