@@ -755,7 +755,7 @@ const nestedMongoObjectToNestedParseObject = mongoObject => {
755
755
756
756
// Converts from a mongo-format object to a REST-format object.
757
757
// Does not strip out anything based on a lack of authentication.
758
- const mongoObjectToParseObject = ( schema , className , mongoObject ) => {
758
+ const mongoObjectToParseObject = ( schemaController , className , mongoObject , schema ) => {
759
759
switch ( typeof mongoObject ) {
760
760
case 'string' :
761
761
case 'number' :
@@ -831,8 +831,8 @@ const mongoObjectToParseObject = (schema, className, mongoObject) => {
831
831
if ( key . indexOf ( '_p_' ) == 0 ) {
832
832
var newKey = key . substring ( 3 ) ;
833
833
var expected ;
834
- if ( schema && schema . getExpectedType ) {
835
- expected = schema . getExpectedType ( className , newKey ) ;
834
+ if ( schemaController && schemaController . getExpectedType ) {
835
+ expected = schemaController . getExpectedType ( className , newKey ) ;
836
836
}
837
837
if ( ! expected ) {
838
838
log . info ( 'transform.js' ,
@@ -861,7 +861,7 @@ const mongoObjectToParseObject = (schema, className, mongoObject) => {
861
861
} else if ( key [ 0 ] == '_' && key != '__type' ) {
862
862
throw ( 'bad key in untransform: ' + key ) ;
863
863
} else {
864
- var expectedType = schema . getExpectedType ( className , key ) ;
864
+ var expectedType = schemaController . getExpectedType ( className , key ) ;
865
865
var value = mongoObject [ key ] ;
866
866
if ( expectedType && expectedType . type === 'File' && FileCoder . isValidDatabaseObject ( value ) ) {
867
867
restObject [ key ] = FileCoder . databaseToJSON ( value ) ;
@@ -876,7 +876,7 @@ const mongoObjectToParseObject = (schema, className, mongoObject) => {
876
876
}
877
877
}
878
878
879
- return { ...restObject , ...schema . getRelationFields ( className ) } ;
879
+ return { ...restObject , ...schemaController . getRelationFields ( className ) } ;
880
880
default :
881
881
throw 'unknown js type' ;
882
882
}
0 commit comments