Skip to content

Commit

Permalink
model.fetch party, change members array, then push
Browse files Browse the repository at this point in the history
  • Loading branch information
lefnire committed Feb 19, 2013
1 parent fc49e57 commit 6229a8e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/app/party.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,13 @@ module.exports.app = (appExports, model) ->
partyId = user.get('party.invitation')
user.set 'party.invitation', null
user.set 'party.current', partyId
model.fetch model.query('parties').withId(partyId), (err, p) ->
throw err if err
debugger
p.at(0).at('members').push user.get('id'), ->
setTimeout (-> window.location.reload true), 10
# model.push "parties.#{partyId}.members", user.get('id'), -> #FIXME why this not working?
model.query('parties').withId(partyId).fetch (err, p) ->
members = p.at(0).get('members')
members.push user.get('id')
p.at(0).set 'members', members, ->
debugger
window.location.reload true
# partySubscribe model, ->
# p = model.at('_party')
# p.push 'members', user.get('id')
Expand Down

0 comments on commit 6229a8e

Please sign in to comment.