Taichi Masuyama 4 лет назад
Родитель
Сommit
78fc071abb
1 измененных файлов с 2 добавлено и 3 удалено
  1. 2 3
      packages/app/src/server/models/user-group.js

+ 2 - 3
packages/app/src/server/models/user-group.js

@@ -6,14 +6,13 @@ const mongoosePaginate = require('mongoose-paginate-v2');
 /*
  * define schema
  */
-const ObjectIdType = mongoose.Schema.Types.ObjectId;
-const ObjectId = mongoose.Types.ObjectId;
+const ObjectId = mongoose.Schema.Types.ObjectId;
 
 const schema = new mongoose.Schema({
   userGroupId: String,
   name: { type: String, required: true, unique: true },
   createdAt: { type: Date, default: Date.now },
-  parent: { type: ObjectIdType, ref: 'UserGroup', index: true },
+  parent: { type: ObjectId, ref: 'UserGroup', index: true },
   description: { type: String },
 });
 schema.plugin(mongoosePaginate);