File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,8 @@ function classNameIsValid(className) {
76
76
className === '_SCHEMA' || //TODO: remove this, as _SCHEMA is not a valid class name for storing Parse Objects.
77
77
className === '_Role' ||
78
78
joinClassRegex . test ( className ) ||
79
- classAndFieldRegex . test ( className )
79
+ //Class names have the same constraints as field names, but also allow the previous additional names.
80
+ fieldNameIsValid ( className )
80
81
) ;
81
82
}
82
83
Original file line number Diff line number Diff line change @@ -32,10 +32,10 @@ function mongoFieldTypeToSchemaAPIType(type) {
32
32
33
33
function mongoSchemaAPIResponseFields ( schema ) {
34
34
fieldNames = Object . keys ( schema ) . filter ( key => key !== '_id' ) ;
35
- response = { } ;
36
- fieldNames . forEach ( fieldName => {
37
- response [ fieldName ] = mongoFieldTypeToSchemaAPIType ( schema [ fieldName ] ) ;
38
- } ) ;
35
+ response = fieldNames . reduce ( ( obj , fieldName ) => {
36
+ obj [ fieldName ] = mongoFieldTypeToSchemaAPIType ( schema [ fieldName ] )
37
+ return obj ;
38
+ } , { } ) ;
39
39
response . ACL = { type : 'ACL' } ;
40
40
response . createdAt = { type : 'Date' } ;
41
41
response . updatedAt = { type : 'Date' } ;
You can’t perform that action at this time.
0 commit comments