File tree 2 files changed +12
-12
lines changed
2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,8 @@ describe('Parse.User testing', () => {
246
246
await adapter . connect ( ) ;
247
247
await adapter . database . dropDatabase ( ) ;
248
248
delete adapter . connectionPromise ;
249
+ const { database } = Config . get ( Parse . applicationId ) ;
250
+ database . schemaCache . clear ( ) ;
249
251
250
252
const user = new Parse . User ( ) ;
251
253
await user . signUp ( {
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ function getOneSchema(req) {
35
35
} ) ;
36
36
}
37
37
38
- function createSchema ( req ) {
38
+ async function createSchema ( req ) {
39
39
if ( req . auth . isReadOnly ) {
40
40
throw new Parse . Error (
41
41
Parse . Error . OPERATION_FORBIDDEN ,
@@ -53,17 +53,15 @@ function createSchema(req) {
53
53
throw new Parse . Error ( 135 , `POST ${ req . path } needs a class name.` ) ;
54
54
}
55
55
56
- return req . config . database
57
- . loadSchema ( { clearCache : true } )
58
- . then ( schema =>
59
- schema . addClassIfNotExists (
60
- className ,
61
- req . body . fields ,
62
- req . body . classLevelPermissions ,
63
- req . body . indexes
64
- )
65
- )
66
- . then ( schema => ( { response : schema } ) ) ;
56
+ const schema = await req . config . database . loadSchema ( { clearCache : true } ) ;
57
+ const parseSchema = await schema . addClassIfNotExists (
58
+ className ,
59
+ req . body . fields ,
60
+ req . body . classLevelPermissions ,
61
+ req . body . indexes
62
+ ) ;
63
+ await schema . reloadData ( { clearCache : true } ) ;
64
+ return { response : parseSchema } ;
67
65
}
68
66
69
67
function modifySchema ( req ) {
You can’t perform that action at this time.
0 commit comments