codecombat/server/handlers/level_feedback_handler.coffee

16 lines
518 B
CoffeeScript
Raw Normal View History

2016-04-07 12:40:53 -04:00
LevelFeedback = require './../models/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']
2016-04-07 12:40:53 -04:00
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()