mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 22:13:32 -04:00
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
|
||||
@fetch(options)
|
||||
me.get('courseInstances').push(@id) if userID is me.id
|
||||
|
||||
removeMember: (userID, opts) ->
|
||||
options = {
|
||||
|
@ -31,6 +32,7 @@ module.exports = class CourseInstance extends CocoModel
|
|||
}
|
||||
_.extend options, opts
|
||||
@fetch(options)
|
||||
me.set('courseInstances', _.without(me.get('courseInstances'), @id)) if userID is me.id
|
||||
|
||||
firstLevelURL: ->
|
||||
"/play/level/dungeons-of-kithgard?course=#{@get('courseID')}&course-instance=#{@id}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue