Is it possible to assign the function renderAnswers()
to a question in a POST request? How can I do this correctly for it to work as intended?
methods: {
renderAnswers() {
let answers = this.question;
let newAnswers = answers.map((isAnswer) => ({
answer: isAnswer,
}))
console.log(newAnswers);
},
async createQuiz(quiz, question) {
try {
let add = await axios.post("http://localhost:3000/v1/quiz/" , {
name: quiz.name,
type: question.type,
question: this.renderAnswers(),
});
router.push({path: '/listQuizzesInstructor'});
} catch(e) {
this.errors.push(e);
}
}