@@ -95,10 +95,10 @@ class ParseConfig {
95
95
* @return {Promise } A promise that is resolved with a newly-created
96
96
* configuration object or with the current with the update.
97
97
*/
98
- static save ( attrs : { [ key : string ] : any } ) {
98
+ static save ( attrs : { [ key : string ] : any } , masterKeyOnly : { [ key : string ] : any } ) {
99
99
const controller = CoreManager . getConfigController ( ) ;
100
100
//To avoid a mismatch with the local and the cloud config we get a new version
101
- return controller . save ( attrs ) . then ( ( ) => {
101
+ return controller . save ( attrs , masterKeyOnly ) . then ( ( ) => {
102
102
return controller . get ( ) ;
103
103
} , ( error ) => {
104
104
return Promise . reject ( error ) ;
@@ -184,16 +184,20 @@ const DefaultController = {
184
184
} ) ;
185
185
} ,
186
186
187
- save ( attrs : { [ key : string ] : any } ) {
187
+ save ( attrs : { [ key : string ] : any } , masterKeyOnly : { [ key : string ] : any } ) {
188
188
const RESTController = CoreManager . getRESTController ( ) ;
189
189
const encodedAttrs = { } ;
190
+ const encodedMasterKeyOnly = { } ;
190
191
for ( const key in attrs ) {
191
192
encodedAttrs [ key ] = encode ( attrs [ key ] )
192
193
}
194
+ for ( const key in masterKeyOnly ) {
195
+ encodedMasterKeyOnly [ key ] = encode ( masterKeyOnly [ key ] )
196
+ }
193
197
return RESTController . request (
194
198
'PUT' ,
195
199
'config' ,
196
- { params : encodedAttrs } ,
200
+ { params : encodedAttrs , masterKeyOnly : encodedMasterKeyOnly } ,
197
201
{ useMasterKey : true }
198
202
) . then ( response => {
199
203
if ( response && response . result ) {
0 commit comments