Browse Source

修改接口

zs 2 năm trước cách đây
mục cha
commit
704895436f
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/service/studio.service.ts

+ 2 - 2
src/service/studio.service.ts

@@ -26,11 +26,11 @@ export class StudioService extends BaseService<modelType> {
     const data = await this.model.findOne({ name: body.name });
     if (data) {
       if (String(data._id) === id) {
-        return this.model.updateOne({ _id: new ObjectId(body.id) }, body);
+        return this.model.updateOne({ _id: new ObjectId(id) }, body);
       }
       throw new ServiceError(FrameworkErrorEnum.BAD_BODY, '工作室名称已被占用');
     } else {
-      return this.model.updateOne({ _id: new ObjectId(body.id) }, body);
+      return this.model.updateOne({ _id: new ObjectId(id) }, body);
     }
   }
 }