Skip to content

Commit

Permalink
Merge pull request #137 from jacobrs/olivier
Browse files Browse the repository at this point in the history
#129 Redirecting on form submition
  • Loading branch information
ONourry committed Apr 11, 2017
2 parents 096a3ab + c613cd9 commit f6c0173
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/modules/User/UserActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export function addUser(user) {
}

export function addUserRequest(user) {

return (dispatch) => {
return callApi('users', 'post', {
user: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component, PropTypes } from 'react';
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
import { Link, browserHistory } from 'react-router';
import Validation from 'react-validation';

import Valid from '../FormComponents/Validator';
Expand Down Expand Up @@ -37,6 +37,7 @@ export class UserRegistrationForm extends Component {
this.setState({ nickname: '', studentId: '', email: '', password: '', passwordConfirm: '' });
//To stop the page from refreshing
e.preventDefault();
browserHistory.push('/');
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component, PropTypes } from 'react';
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
import Validation from 'react-validation';
import { browserHistory } from 'react-router';

import Valid from '../FormComponents/Validator';
import styles from './UserStudyGroupForm.css';
Expand Down Expand Up @@ -35,6 +36,7 @@ export class UserStudyGroupForm extends Component {
console.log(this.state);
this.setState({ groupName: '', course: '', teacher: '', description: '' });
e.preventDefault();
browserHistory.push('/profile');
}
};

Expand Down

0 comments on commit f6c0173

Please sign in to comment.