Merge pull request #10144 from Budibase/BUDI-6791/fix_config_frontend
BUDI-6791 - Fix config frontend
This commit is contained in:
commit
1db9d4d23c
|
@ -24,7 +24,9 @@
|
|||
try {
|
||||
await API.saveConfig({
|
||||
type: configType,
|
||||
enabled: scimEnabled,
|
||||
config: {
|
||||
enabled: scimEnabled,
|
||||
},
|
||||
})
|
||||
notifications.success(`Settings saved`)
|
||||
} catch (e) {
|
||||
|
@ -36,7 +38,7 @@
|
|||
async function fetchConfig() {
|
||||
try {
|
||||
const scimConfig = await API.getConfig(configType)
|
||||
scimEnabled = scimConfig?.enabled
|
||||
scimEnabled = scimConfig?.config?.enabled
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
notifications.error("Error fetching SCIM config")
|
||||
|
|
|
@ -39,7 +39,7 @@ export const createFeatureStore = () => {
|
|||
...state,
|
||||
scim: {
|
||||
...state.scim,
|
||||
isConfigFlagEnabled: scimConfig.enabled,
|
||||
isConfigFlagEnabled: scimConfig?.config?.enabled,
|
||||
},
|
||||
}))
|
||||
},
|
||||
|
|
|
@ -58,6 +58,13 @@ function oidcValidation() {
|
|||
}).unknown(true)
|
||||
}
|
||||
|
||||
function scimValidation() {
|
||||
// prettier-ignore
|
||||
return Joi.object({
|
||||
enabled: Joi.boolean().required(),
|
||||
}).unknown(true)
|
||||
}
|
||||
|
||||
function buildConfigSaveValidation() {
|
||||
// prettier-ignore
|
||||
return auth.joiValidator.body(Joi.object({
|
||||
|
@ -74,7 +81,8 @@ function buildConfigSaveValidation() {
|
|||
{ is: ConfigType.SETTINGS, then: settingValidation() },
|
||||
{ is: ConfigType.ACCOUNT, then: Joi.object().unknown(true) },
|
||||
{ is: ConfigType.GOOGLE, then: googleValidation() },
|
||||
{ is: ConfigType.OIDC, then: oidcValidation() }
|
||||
{ is: ConfigType.OIDC, then: oidcValidation() },
|
||||
{ is: ConfigType.SCIM, then: scimValidation() }
|
||||
],
|
||||
}),
|
||||
}).required().unknown(true),
|
||||
|
|
Loading…
Reference in New Issue