codecombat/app/collections/Levels.coffee

19 lines
602 B
CoffeeScript
Raw Normal View History

2016-03-30 16:57:19 -04:00
CocoCollection = require 'collections/CocoCollection'
Level = require 'models/Level'
module.exports = class LevelCollection extends CocoCollection
url: '/db/level'
model: Level
2016-04-13 12:54:24 -04:00
fetchForClassroom: (classroomID, options={}) ->
options.url = "/db/classroom/#{classroomID}/levels"
2016-04-13 12:54:24 -04:00
@fetch(options)
fetchForClassroomAndCourse: (classroomID, courseID, options={}) ->
options.url = "/db/classroom/#{classroomID}/courses/#{courseID}/levels"
@fetch(options)
fetchForCampaign: (campaignSlug, options={}) ->
options.url = "/db/campaign/#{campaignSlug}/levels"
2016-04-13 12:54:24 -04:00
@fetch(options)