lrf402788946 %!s(int64=4) %!d(string=hai) anos
pai
achega
ba3a68c50d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/service/student.js

+ 1 - 1
app/service/student.js

@@ -58,7 +58,7 @@ class StudentService extends CrudService {
     const student = await this.model.findByIdAndUpdate(id, data);
     if (student) {
       const { phone, name } = data;
-      await this.umodel.findOneAndUpdate({ uid: id }, { mobile: phone, name });
+      if (phone && name) { await this.umodel.findOneAndUpdate({ uid: id }, { mobile: phone, name }); }
     }
     return student;
   }