mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
16 lines
No EOL
499 B
CoffeeScript
16 lines
No EOL
499 B
CoffeeScript
Achievement = require './Achievement'
|
|
Handler = require '../commons/Handler'
|
|
|
|
class AchievementHandler extends Handler
|
|
modelClass: Achievement
|
|
|
|
jsonSchema = require '../../app/schemas/models/achievement.coffee'
|
|
|
|
getAll: (req, res) ->
|
|
query = @modelClass.find({})
|
|
query.exec (err, documents) =>
|
|
return @sendDatabaseError(res, err) if err
|
|
documents = (@formatEntity(req, doc) for doc in documents)
|
|
@sendSuccess(res, documents)
|
|
|
|
module.exports = new AchievementHandler() |