mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -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,
|
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
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue