begins refactor of Checkbox field type

This commit is contained in:
James
2020-06-15 17:40:04 -04:00
parent 575ac55c4e
commit 99f04729ba
7 changed files with 91 additions and 110 deletions

View File

@@ -1,20 +1,11 @@
const validations = require('../fields/validations');
module.exports = [
{
name: 'enableAPIKey',
label: 'Enable API key for this user',
type: 'checkbox',
defaultValue: false,
validate: validations.checkbox,
},
{
name: 'apiKey',
type: 'text',
label: 'User API Key',
condition: (_, siblings) => {
return siblings.enableAPIKey && siblings.enableAPIKey.value;
},
validate: validations.text,
},
];