mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 15:17:53 -05:00
use state.classroom.id instead of url param classroomId
This commit is contained in:
parent
81678b70a7
commit
2972c528f4
1 changed files with 2 additions and 4 deletions
|
@ -75,7 +75,7 @@ class StudentRegistration extends React.Component {
|
|||
),
|
||||
country: formData.user.country,
|
||||
is_robot: formData.user.isRobot,
|
||||
classroom_id: this.props.classroomId,
|
||||
classroom_id: this.state.classroom.id,
|
||||
classroom_token: this.props.classroomToken
|
||||
}
|
||||
}, (err, body, res) => {
|
||||
|
@ -100,7 +100,7 @@ class StudentRegistration extends React.Component {
|
|||
});
|
||||
}
|
||||
handleGoToClass () {
|
||||
window.location = `/classes/${this.props.classroomId}/`;
|
||||
window.location = `/classes/${this.state.classroom.id}/`;
|
||||
}
|
||||
render () {
|
||||
const usernameDescription = this.props.intl.formatMessage({id: 'registration.studentUsernameStepDescription'});
|
||||
|
@ -151,13 +151,11 @@ class StudentRegistration extends React.Component {
|
|||
}
|
||||
|
||||
StudentRegistration.propTypes = {
|
||||
classroomId: PropTypes.string.isRequired,
|
||||
classroomToken: PropTypes.string.isRequired,
|
||||
intl: intlShape
|
||||
};
|
||||
|
||||
StudentRegistration.defaultProps = {
|
||||
classroomId: null,
|
||||
classroomToken: null
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue