mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 15:48:11 -05:00
Patch Earned Achievements more generally.
This commit is contained in:
parent
d292e180d2
commit
782aacf35e
2 changed files with 3 additions and 3 deletions
|
@ -66,4 +66,5 @@ module.exports.modules = modules = # by collection name
|
|||
'users': 'User'
|
||||
|
||||
mongoose.modelNameByCollection = (collection) ->
|
||||
return require('../models/LevelSession') if collection is 'level.session'
|
||||
mongoose.model modules[collection] if collection of modules
|
||||
|
|
|
@ -51,9 +51,8 @@ class EarnedAchievementHandler extends Handler
|
|||
collection = req.body.collection
|
||||
if collection isnt 'level.sessions'
|
||||
return @sendBadInputError(res, 'Only doing level session achievements for now.')
|
||||
#model = mongoose.modelNameByCollection(collection)
|
||||
else
|
||||
model = LevelSession
|
||||
|
||||
model = mongoose.modelNameByCollection(collection)
|
||||
|
||||
async.parallel({
|
||||
achievement: (callback) ->
|
||||
|
|
Loading…
Reference in a new issue