codecombat/app/collections/CourseInstances.coffee

18 lines
625 B
CoffeeScript
Raw Normal View History

2016-03-30 16:57:19 -04:00
CourseInstance = require 'models/CourseInstance'
CocoCollection = require 'collections/CocoCollection'
module.exports = class CourseInstances extends CocoCollection
model: CourseInstance
url: '/db/course_instance'
fetchByOwner: (ownerID, options={}) ->
ownerID = ownerID.id or ownerID # handle if they pass in a user
options.data ?= {}
options.data.ownerID = ownerID
@fetch(options)
2016-04-13 12:54:24 -04:00
fetchForClassroom: (classroomID, options={}) ->
classroomID = classroomID.id or classroomID # handle if they pass in a user
options.data ?= {}
options.data.classroomID = classroomID
@fetch(options)