不能修改此记录的name属性

This commit is contained in:
Byran 2022-01-17 16:50:04 +08:00
parent 08bc891736
commit e053606f4a
2 changed files with 2 additions and 2 deletions

View File

@ -204,7 +204,7 @@ Creator.Objects.object_fields =
when: "before.update"
todo: (userId, doc, fieldNames, modifier, options)->
if doc.name == 'name' && modifier?.$set?.name && doc.name != modifier.$set.name
throw new Meteor.Error 500, "不能修改此录的name属性"
throw new Meteor.Error 500, "不能修改此录的name属性"
if modifier?.$set?.name && isRepeatedName(doc, modifier.$set.name)
console.log("update fields对象名称不能重复#{doc.name}")
throw new Meteor.Error 500, "对象名称不能重复"

View File

@ -386,7 +386,7 @@ var triggers = {
// }
if (doc.name === 'name' && _.has(modifier.$set, '_name') && doc.name !== modifier.$set._name) {
throw new Meteor.Error(500, "不能修改此录的name属性");
throw new Meteor.Error(500, "不能修改此录的name属性");
}
if(_.has(modifier.$set, "_name")){