When adding and removing oneself from course instances, client locally updates me.courseInstances
This commit is contained in:
parent
89aeac9424
commit
3f31c9b4dd
1 changed files with 2 additions and 0 deletions
|
@ -22,6 +22,7 @@ module.exports = class CourseInstance extends CocoModel
|
||||||
}
|
}
|
||||||
_.extend options, opts
|
_.extend options, opts
|
||||||
@fetch(options)
|
@fetch(options)
|
||||||
|
me.get('courseInstances').push(@id) if userID is me.id
|
||||||
|
|
||||||
removeMember: (userID, opts) ->
|
removeMember: (userID, opts) ->
|
||||||
options = {
|
options = {
|
||||||
|
@ -31,6 +32,7 @@ module.exports = class CourseInstance extends CocoModel
|
||||||
}
|
}
|
||||||
_.extend options, opts
|
_.extend options, opts
|
||||||
@fetch(options)
|
@fetch(options)
|
||||||
|
me.set('courseInstances', _.without(me.get('courseInstances'), @id)) if userID is me.id
|
||||||
|
|
||||||
firstLevelURL: ->
|
firstLevelURL: ->
|
||||||
"/play/level/dungeons-of-kithgard?course=#{@get('courseID')}&course-instance=#{@id}"
|
"/play/level/dungeons-of-kithgard?course=#{@get('courseID')}&course-instance=#{@id}"
|
||||||
|
|
Reference in a new issue