I see that the the ArticleUserModel structure contains a reference to models.User.
That is I get the reference of the author (a user object).
But what if I want to list all the articles written by a given user ? I would need a reference of models.Article in the user model. Wouldn't that cause a cyclic dependency error ?
How can we get around this problem ? Other than extracting the models in a separate package outside both user and article ?
Sorry for the delay,
I think you could write another api, depend on the user and article or other data models.
Then, alias/redirect the router to the new api.
I see that the the ArticleUserModel structure contains a reference to models.User.
That is I get the reference of the author (a user object).
But what if I want to list all the articles written by a given user ? I would need a reference of models.Article in the user model. Wouldn't that cause a cyclic dependency error ?
How can we get around this problem ? Other than extracting the models in a separate package outside both user and article ?