lrf402788946 4 rokov pred
rodič
commit
65b767cb39
1 zmenil súbory, kde vykonal 3 pridanie a 1 odobranie
  1. 3 1
      app/service/lesson.js

+ 3 - 1
app/service/lesson.js

@@ -361,7 +361,9 @@ class LessonService extends CrudService {
       const teacherList = _.compact(_.uniq(lessons.map(i => i.teaid)));
       if (teacherList) {
         for (const tea of teacherList) {
-          const r = await this.toSendMsg(tea, 'teacher', termnum, nres._id, content);
+          const teacher = await this.teamodel.findById(tea);
+          if (!teacher) continue;
+          const r = await this.toSendMsg(teacher, 'teacher', termnum, nres._id, content);
           if (r && is_update) nres.notified.push(r);
           else if (r && !is_update) {
             const dr = nres.notified.find(f => f.notifiedid === r.notifiedid);