Skip to content

Commit

Permalink
Merge pull request #26 from VPatient/lifeActivityFormsUpdate
Browse files Browse the repository at this point in the history
re-re-recorrection of return format
  • Loading branch information
Tzesh committed Mar 30, 2023
2 parents f0b5fdd + 8278c22 commit c5b4a53
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions routes/patient/lifeactivity/lifeactivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,19 @@ router.get("", auth, verifyPatient, async(req, res) => {
"form_title": form.name,
"form_sequence": form.sequence,
"data": [{
"questions": [
questions.filter(question => question.form.toString() === form._id.toString()).map(question => {
return {
"question_id": question._id,
"fields": question.fields,
"correct_answer": records.find(record => record.question.toString() === question._id.toString()).correct_answer,
"title": question.title,
"description": "",
"type": question.type,
"remark": question.remark,
"is_mandatory": question.is_mandatory,
"show_answer": question.show_answer
}
})
]
"questions": questions.filter(question => question.form.toString() === form._id.toString()).map(question => {
return {
"question_id": question._id,
"fields": question.fields,
"correct_answer": records.find(record => record.question.toString() === question._id.toString()).correct_answer,
"title": question.title,
"description": "",
"type": question.type,
"remark": question.remark,
"is_mandatory": question.is_mandatory,
"show_answer": question.show_answer
}
})
}]
}
});
Expand Down

0 comments on commit c5b4a53

Please sign in to comment.