codecombat/server/levels/feedbacks/level_feedback_handler.coffee

16 lines
516 B
CoffeeScript
Raw Normal View History

LevelFeedback = require('./LevelFeedback')
Handler = require('../../commons/Handler')
2014-01-03 13:32:13 -05:00
class LevelFeedbackHandler extends Handler
modelClass: LevelFeedback
editableProperties: ['rating', 'review', 'level', 'levelID', 'levelName']
jsonSchema: require '../../../app/schemas/models/level_feedback'
2014-01-03 13:32:13 -05:00
makeNewInstance: (req) ->
feedback = super(req)
feedback.set('creator', req.user._id)
feedback.set('creatorName', req.user.get('name') or '')
feedback
module.exports = new LevelFeedbackHandler()