I have two models (user & agent). I then create a user and an agent. I am expecting to see the association when using the blueprint routes for BOTH /user and /agent. I am only seeing the user model is associated with an agent via the /agent blueprint. The /user blueprint does not have any reference/association to an Agent.
The issue presents itself when I am trying to access the Agent via A userId with the following command:
User.findOne(req.body.userId).populate('agent').exec(function(err, agent)
"agent" is in fact the user information...not the agent.
Here are my models:
User:
attributes: {
agent: {
model: 'agent',
via: 'owner'
}
}
Agent:
attributes: {
owner: {
model: 'user'
}
}
Thanks for reading!