Conversation
models/team.js
Outdated
| name: DataTypes.STRING, | ||
| description: DataTypes.STRING, | ||
| timestamps: true, | ||
| }) |
There was a problem hiding this comment.
Please add a return statement as well
return Team
its expected in index.js on line no 51. thats why your build is failing : |
models/teamMember.js
Outdated
| timestamps: true, | ||
| }) | ||
| TeamMember.belongsTo(Team, { foreignKey: 'team_id' }) | ||
| TeamMember.belongsTo(User, { foreignKey: 'user_id' }) |
There was a problem hiding this comment.
Please add a return statement as well
return TeamMember
its expected in index.js on line no 51. thats why your build is failing : |
models/teamMember.js
Outdated
| }) | ||
| TeamMember.belongsTo(Team, { foreignKey: 'team_id' }) | ||
| TeamMember.belongsTo(User, { foreignKey: 'user_id' }) | ||
| TeamMember.belongsTo(Team, { foreignKey: 'team_id' }); |
There was a problem hiding this comment.
the build is still failing because you are using TeamMember.belongsTo in a wrong way you need to do it like this,
TeamMember.associate = (models) => { TeamMember.belongsTo(models.Team, { foreignKey: 'team_id'}) }
something like this, in your current implementation it could be possible that Team that you are importing is a empty object ... also remove the imports at the top they are not needed anymore
There was a problem hiding this comment.
for reference you can have a look at this file
here
|
I think you are forgetting 1 belongs to condition here which refers to the connection with user table |
|
Also you still forgot to remove the import statement at the top of the file : \ |
|
oh sorry |
rogdevil
left a comment
There was a problem hiding this comment.
I think we are good to go here @alexanmtz : )
Description
Changes
Issue
Impacted Area
Steps to test
Steps needed to reproduce the scenario from this change to validate if the pull request solve this issue
Before
After