lrf402788946 5 năm trước cách đây
mục cha
commit
160d362457
1 tập tin đã thay đổi với 6 bổ sung6 xóa
  1. 6 6
      app/service/dock.js

+ 6 - 6
app/service/dock.js

@@ -52,15 +52,15 @@ class ChatService extends CrudService {
     return res;
   }
   async dockCheck({ id }, { is_allowed, reason = '' }) {
-    const res = this.model.findOne(id);
-    if (!res) {
+    const dock = this.model.findOne({ _id: ObjectId(id) });
+    if (!dock) {
       throw new BusinessError('没有查询到该对接会');
     }
     assert(is_allowed, '请选择审核结果');
-    res.is_allowed = is_allowed;
-    res.reason = reason;
-    const ret = res.save();
-    return ret;
+    dock.is_allowed = is_allowed;
+    dock.reason = reason;
+    const res = dock.save();
+    return res;
   }
 }