added children to users
This commit is contained in:
@@ -164,14 +164,27 @@ var Register = React.createClass({
|
||||
},
|
||||
register: function(e) {
|
||||
if(this.validate()) {
|
||||
var children = [];
|
||||
if (this.state.myBabyDetailsVisible) {
|
||||
children.push({
|
||||
name: 'Dijete',
|
||||
gender: 1
|
||||
});
|
||||
}
|
||||
|
||||
var user = new UserRegistration({
|
||||
first_name: this.state.firstName,
|
||||
last_name: this.state.lastName,
|
||||
email: this.state.email,
|
||||
password: this.state.password,
|
||||
password_confirmation: this.state.passwordConfirmation
|
||||
password_confirmation: this.state.passwordConfirmation,
|
||||
children_attributes : children
|
||||
|
||||
});
|
||||
|
||||
// need to add info about child
|
||||
|
||||
|
||||
UserActions.registerUser(user);
|
||||
}
|
||||
|
||||
@@ -263,8 +276,8 @@ var Register = React.createClass({
|
||||
<div className="col-md-4">
|
||||
|
||||
<button onClick={this.register} type="button" className="btn btn-default btn-lg">
|
||||
Register2
|
||||
</button>
|
||||
Registruj me
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
Reference in New Issue
Block a user