liuyu пре 4 година
родитељ
комит
36d0248bbd
1 измењених фајлова са 1 додато и 6 уклоњено
  1. 1 6
      app/service/group.js

+ 1 - 6
app/service/group.js

@@ -90,15 +90,10 @@ class GroupService extends CrudService {
     const data = [];
     for (const _group of res) {
       const group = _.cloneDeep(JSON.parse(JSON.stringify(_group)));
-      const students_ = [];
       for (const stu of group.students) {
         const student = await this.smodel.findOne({ id: stu.stuid });
-        if (student) {
-          const newdata = { ...JSON.parse(JSON.stringify(stu)), job: student.job };
-          students_.push(newdata);
-        }
+        if (student) stu.job = student.job;
       }
-      group.students = students_;
       data.push(group);
     }
     return { total, data };