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

Method addMembers

app/models/CourseInstance.js:41–59  ·  view source on GitHub ↗
(userIDs, opts)

Source from the content-addressed store, hash-verified

39 }
40
41 addMembers (userIDs, opts) {
42 const options = {
43 method: 'POST',
44 url: _.result(this, 'url') + '/members',
45 data: { userIDs },
46 success: () => {
47 return this.trigger('add-members', { userIDs })
48 }
49 }
50 _.extend(options, opts)
51 const jqxhr = this.fetch(options)
52 if (Array.from(userIDs).includes(me.id)) {
53 if (!me.get('courseInstances')) {
54 me.set('courseInstances', [])
55 }
56 me.get('courseInstances').push(this.id)
57 }
58 return jqxhr
59 }
60
61 removeMember (userID, opts) {
62 const options = {

Callers 5

assignCourseFunction · 0.80
classrooms.jsFile · 0.80
assignCourseMethod · 0.80

Calls 3

fetchMethod · 0.45
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected