Fix add field to system schema

This commit is contained in:
Marco129
2016-03-04 20:44:21 +08:00
parent e3d26e2b4e
commit 8814e1f3b5
2 changed files with 58 additions and 1 deletions

View File

@@ -85,7 +85,7 @@ function modifySchema(req) {
throw new Parse.Error(Parse.Error.INVALID_CLASS_NAME, `Class ${req.params.className} does not exist.`);
}
let existingFields = schema.data[className];
let existingFields = Object.assign(schema.data[className], {_id: className});
Object.keys(submittedFields).forEach(name => {
let field = submittedFields[name];
if (existingFields[name] && field.__op !== 'Delete') {