codecombat/app/models/Classroom.coffee
Scott Erickson ea4a98af86 Add rest of CoursesView, untested, unhooked to server
On a plane, so skipping my usual iterative testing.
Bugs are undoubtedly everywhere.
2015-11-23 08:46:08 -08:00

16 lines
No EOL
400 B
CoffeeScript

CocoModel = require './CocoModel'
schema = require 'schemas/models/classroom.schema'
module.exports = class Classroom extends CocoModel
@className: 'Classroom'
@schema: schema
urlRoot: '/db/classroom'
joinWithCode: (code, opts) ->
options = {
url: _.result(@, 'url') + '/~/members'
type: 'POST'
data: { code: code }
}
_.extend options, opts
@fetch(options)