codecombat/server/levels/feedbacks/level_feedback_handler.coffee
Sébastien Moratinos 729cd300b7 server reorganize files and folder by features
- move and rename files
- use associative arrays which store handlers for 'dynamically'
  load module from de db route
- store models_path in test/server/common,
  a global model variable has the same name that the filename of the model
2014-01-23 01:01:40 +01:00

14 lines
449 B
CoffeeScript

LevelFeedback = require('./LevelFeedback')
Handler = require('../../commons/Handler')
class LevelFeedbackHandler extends Handler
modelClass: LevelFeedback
editableProperties: ['rating', 'review', 'level', 'levelID', 'levelName']
makeNewInstance: (req) ->
feedback = super(req)
feedback.set('creator', req.user._id)
feedback.set('creatorName', req.user.get('name') or '')
feedback
module.exports = new LevelFeedbackHandler()