|
@@ -53,7 +53,16 @@ class QuestionnaireService extends CrudService {
|
|
|
questionnaire.type = type;
|
|
|
}
|
|
|
if (question) {
|
|
|
- questionnaire.question = question;
|
|
|
+ const quedata = [];
|
|
|
+ for (const elm of question) {
|
|
|
+ if (elm && !_.isObject(elm)) {
|
|
|
+ const ques = await this.questionmodel.findById(elm);
|
|
|
+ if (ques) {
|
|
|
+ quedata.push(ques);
|
|
|
+ }
|
|
|
+ } else if (elm) quedata.push(elm);
|
|
|
+ }
|
|
|
+ questionnaire.question = quedata;
|
|
|
}
|
|
|
return await questionnaire.save();
|
|
|
}
|