This commit is contained in:
Torsten Schulz
2024-09-25 18:16:28 +02:00
parent f1a12e90f9
commit b88e7ba13a
2 changed files with 8 additions and 0 deletions

View File

@@ -88,6 +88,13 @@ Location.hasMany(Match, { foreignKey: 'locationId', as: 'matches' });
User.belongsToMany(Club, { through: UserClub, foreignKey: 'userId' });
Club.belongsToMany(User, { through: UserClub, foreignKey: 'clubId' });
UserClub.belongsTo(User, { foreignKey: 'userId', as: 'user' });
User.hasMany(UserClub, { foreignKey: 'userId' });
UserClub.belongsTo(Club, { foreignKey: 'clubId', as: 'club' });
Club.hasMany(UserClub, { foreignKey: 'clubId' });
export {
User,
Log,

View File

@@ -104,6 +104,7 @@ class ClubService {
include: [
{
model: User,
as: 'user',
}
]
});