Closed oreporan closed 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.
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.
I see now that the the League schema has the field
users = []
but also the User schema has the fieldleagues = []
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?