mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 17:41:43 -05:00
more elegant code
This commit is contained in:
parent
3edbd2c97a
commit
aabd1baf93
1 changed files with 3 additions and 6 deletions
|
@ -102,12 +102,9 @@ const getInitialStateFromProps = nextProps => {
|
|||
Object.keys(convertedSchema).forEach(key => {
|
||||
let minCount = convertedSchema[key].minCount;
|
||||
if(minCount) {
|
||||
if(!initialDocument[key])
|
||||
initialDocument[key] = [];
|
||||
let toAdd = minCount - initialDocument[key].length;
|
||||
for( let i = 0; i < toAdd; i++ ) {
|
||||
initialDocument[key] = initialDocument[key] || [];
|
||||
while(initialDocument[key].length < minCount)
|
||||
initialDocument[key].push({});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -150,7 +147,7 @@ class SmartForm extends Component {
|
|||
};
|
||||
}
|
||||
|
||||
defaultValues = {};
|
||||
defaultValues = {};
|
||||
|
||||
submitFormCallbacks = [];
|
||||
successFormCallbacks = [];
|
||||
|
|
Loading…
Add table
Reference in a new issue