codecombat/server/levels/feedbacks/level_feedback_handler.coffee
2014-04-12 10:51:02 -07:00

15 lines
516 B
CoffeeScript

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