use state.classroom.id instead of url param classroomId

This commit is contained in:
Ben Wheeler 2020-04-06 10:36:06 -04:00
parent 81678b70a7
commit 2972c528f4

View file

@ -75,7 +75,7 @@ class StudentRegistration extends React.Component {
), ),
country: formData.user.country, country: formData.user.country,
is_robot: formData.user.isRobot, is_robot: formData.user.isRobot,
classroom_id: this.props.classroomId, classroom_id: this.state.classroom.id,
classroom_token: this.props.classroomToken classroom_token: this.props.classroomToken
} }
}, (err, body, res) => { }, (err, body, res) => {
@ -100,7 +100,7 @@ class StudentRegistration extends React.Component {
}); });
} }
handleGoToClass () { handleGoToClass () {
window.location = `/classes/${this.props.classroomId}/`; window.location = `/classes/${this.state.classroom.id}/`;
} }
render () { render () {
const usernameDescription = this.props.intl.formatMessage({id: 'registration.studentUsernameStepDescription'}); const usernameDescription = this.props.intl.formatMessage({id: 'registration.studentUsernameStepDescription'});
@ -151,13 +151,11 @@ class StudentRegistration extends React.Component {
} }
StudentRegistration.propTypes = { StudentRegistration.propTypes = {
classroomId: PropTypes.string.isRequired,
classroomToken: PropTypes.string.isRequired, classroomToken: PropTypes.string.isRequired,
intl: intlShape intl: intlShape
}; };
StudentRegistration.defaultProps = { StudentRegistration.defaultProps = {
classroomId: null,
classroomToken: null classroomToken: null
}; };