mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
25 lines
No EOL
603 B
CoffeeScript
25 lines
No EOL
603 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)
|
|
|
|
removeMember: (userID, opts) ->
|
|
options = {
|
|
url: _.result(@, 'url') + '/members'
|
|
type: 'DELETE'
|
|
data: { userID: userID }
|
|
}
|
|
_.extend options, opts
|
|
@fetch(options) |