mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 06:23:41 -04:00
Handle the missing classroom error properly I think
This commit is contained in:
parent
7c8a2b3020
commit
21c83fe55c
1 changed files with 1 additions and 1 deletions
|
@ -21,7 +21,7 @@ module.exports =
|
|||
return next() unless code
|
||||
classroom = yield Classroom.findOne({ code: code.toLowerCase() }).select('name ownerID aceConfig')
|
||||
if not classroom
|
||||
res.status(404).send({})
|
||||
throw new errors.NotFound('Classroom not found.')
|
||||
classroom = classroom.toObject()
|
||||
# Tack on the teacher's name for display to the user
|
||||
owner = (yield User.findOne({ _id: mongoose.Types.ObjectId(classroom.ownerID) }).select('name')).toObject()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue