codecombat/app/models/Classroom.coffee

16 lines
400 B
CoffeeScript
Raw Normal View History

2015-11-03 19:41:06 -05:00
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)