mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
Merge pull request #751 from rschamp/bugfix/747
Show an error if the API doesn't return class data
This commit is contained in:
commit
401edb354d
1 changed files with 3 additions and 1 deletions
|
@ -37,10 +37,12 @@ var StudentCompleteRegistration = intl.injectIntl(React.createClass({
|
|||
this.props.session.session.permissions &&
|
||||
this.props.session.session.permissions.student) {
|
||||
var classroomId = this.props.session.session.user.classroomId;
|
||||
this.setState({waiting: true});
|
||||
api({
|
||||
uri: '/classrooms/' + classroomId
|
||||
}, function (err, body, res) {
|
||||
if (err || res.statusCode === 404) {
|
||||
this.setState({waiting: false});
|
||||
if (err || res.statusCode !== 200) {
|
||||
return this.setState({
|
||||
registrationErrors: {
|
||||
__all__: this.props.intl.formatMessage({id: 'studentRegistration.classroomApiGeneralError'})
|
||||
|
|
Loading…
Reference in a new issue