I sent this request which is an array of objects from reactjs app to nodejs(sequelize,mysql)backend
{
"Qusetion":"new question",
"Qusetiontype":"AddedAnswers",
"Qusetionanswers":[
{
"QuestionAnswer":"a1"
},
{
"QuestionAnswer":"a2"
}
],
"Surveyid":"9fe96b40-7704-11e9-b46f-3f2c20a71682"
}
the nodejs script
QuestionAnswer.create(req.body.Qusetionanswers.map(Answer=>{
Qusetionanswer=Answer.QuestionAnswer,
QuestionId=qid
})
).then(res=>{console.log(res)}).catch(err=>{console.log(err)})
My Problem: I got below error msg in postman when trying to send new question I searched and found that create not accept an array of objects and nothing else.so any help thanks in advance
{
"message": "this.build(...).save is not a function"
}