MCPcopy Index your code
hub / github.com/codecombat/codecombat / joinWithCode

Method joinWithCode

app/models/Classroom.js:59–75  ·  view source on GitHub ↗
(code, opts)

Source from the content-addressed store, hash-verified

57 }
58
59 joinWithCode (code, opts) {
60 let url
61 if ((code.length === 14) && (code.split('-').length === 3)) {
62 url = this.urlRoot + '/join-by-activation-code'
63 } else {
64 url = this.urlRoot + '/~/members'
65 }
66 const options = {
67 url,
68 type: 'POST',
69 data: { code },
70 success: () => this.trigger('join:success'),
71 error: () => this.trigger('join:error')
72 }
73 _.extend(options, opts)
74 return this.fetch(options)
75 }
76
77 fetchByCode (code, opts) {
78 const options = {

Callers 4

joinClassMethod · 0.95
joinClassFunction · 0.95
onSubmitFormMethod · 0.80

Calls 1

fetchMethod · 0.45

Tested by

no test coverage detected