lrf402788946 před 4 roky
rodič
revize
2c756c04df
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      app/service/chatroom.js

+ 1 - 1
app/service/chatroom.js

@@ -18,7 +18,7 @@ class ChatroomService extends CrudService {
     assert(teacher, '缺少教师姓名');
     assert(studentid, '缺少学生id');
     assert(student, '缺少学生姓名');
-    const res = await this.model.find({ teacherid, teacher, studentid, student });
+    const res = await this.model.findOne({ teacherid, teacher, studentid, student });
     if (res) return res;
     const cres = await this.model.create({ teacherid, teacher, studentid, student });
     return cres;