codecombat/server/levels/feedbacks/level_feedback_handler.coffee

16 lines
514 B
CoffeeScript
Raw Normal View History

2014-06-30 22:16:26 -04:00
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()