|
@@ -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);
|
|
|
}
|
|
|
}
|
|
|
}
|