mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 09:31:43 -05:00
Fix case with no field specifier
This commit is contained in:
parent
1b0f148388
commit
e763eba370
1 changed files with 7 additions and 6 deletions
|
@ -217,13 +217,14 @@ class SmartForm extends Component {
|
|||
Get a list of children-fields for a nested field.
|
||||
|
||||
*/
|
||||
getChildFields = fieldName => this.props.fields.reduce((filtered, field) => {
|
||||
const child = field.replace(new RegExp(`^${fieldName}\\.`), '');
|
||||
if(child !== field)
|
||||
return filtered ? filtered.push(child) : [child];
|
||||
getChildFields = fieldName => this.props.fields &&
|
||||
this.props.fields.reduce((filtered, field) => {
|
||||
const child = field.replace(new RegExp(`^${fieldName}\\.`), '');
|
||||
if(child !== field)
|
||||
return filtered ? filtered.push(child) : [child];
|
||||
|
||||
return filtered;
|
||||
}, null);
|
||||
return filtered;
|
||||
}, null);
|
||||
|
||||
/*
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue