oreporan / wePlayMin

WePlay - the social football managing app
0 stars 1 forks source link

Double fields problem #9

Closed oreporan closed 8 years ago

oreporan commented 8 years ago

I see now that the the League schema has the field users = [] but also the User schema has the field leagues = []

So when we have the method addUserToLeague in the leagues Endpoint, we also need to add this league to the User schema...

Its kind of double data...is it a problem?

Yahavw commented 8 years ago

I'm not sure that this is a problem, it will give us a cross data capability. We definitely need to add the League to the user when doing addUserToLeague, maybe from the controller and not from the League model.

oreporan commented 8 years ago

Ok, this is working, we just need to make sure this is done in the controllers.

So if a User adds himself to a game, the users controller calls the Game model to add the user to the game, and then calls the User model to add this game to the user's active games.