diff options
Diffstat (limited to 'apps/settings/src/service/ProfileService.js')
-rw-r--r-- | apps/settings/src/service/ProfileService.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/settings/src/service/ProfileService.js b/apps/settings/src/service/ProfileService.js index ca84316c655..f84135dd9d2 100644 --- a/apps/settings/src/service/ProfileService.js +++ b/apps/settings/src/service/ProfileService.js @@ -45,3 +45,27 @@ export const saveProfileParameterVisibility = async (paramId, visibility) => { return res.data } + +/** + * Save profile default + * + * @param {boolean} isEnabled the default + * @return {object} + */ +export const saveProfileDefault = async (isEnabled) => { + // Convert to string for compatibility + isEnabled = isEnabled ? '1' : '0' + + const url = generateOcsUrl('/apps/provisioning_api/api/v1/config/apps/{appId}/{key}', { + appId: 'settings', + key: 'profile_enabled_by_default', + }) + + await confirmPassword() + + const res = await axios.post(url, { + value: isEnabled, + }) + + return res.data +} |