(context, paramName, value, isMasterKeyOnly = false)
| 7 | const globalConfigRouter = new GlobalConfigRouter(); |
| 8 | |
| 9 | const updateCloudConfig = async (context, paramName, value, isMasterKeyOnly = false) => { |
| 10 | const { config, auth } = context; |
| 11 | |
| 12 | if (!auth.isMaster) { |
| 13 | throw createSanitizedError( |
| 14 | Parse.Error.OPERATION_FORBIDDEN, |
| 15 | 'Master Key is required to update GlobalConfig.' |
| 16 | ); |
| 17 | } |
| 18 | |
| 19 | await globalConfigRouter.updateGlobalConfig({ |
| 20 | body: { |
| 21 | params: { [paramName]: value }, |
| 22 | masterKeyOnly: { [paramName]: isMasterKeyOnly }, |
| 23 | }, |
| 24 | config, |
| 25 | auth, |
| 26 | context, |
| 27 | }); |
| 28 | |
| 29 | return { value, isMasterKeyOnly }; |
| 30 | }; |
| 31 | |
| 32 | const load = parseGraphQLSchema => { |
| 33 | const updateCloudConfigMutation = mutationWithClientMutationId({ |
no test coverage detected