From f1a12e90f9848a5af1be605b1a70da0738d5909f Mon Sep 17 00:00:00 2001 From: Torsten Schulz Date: Wed, 25 Sep 2024 18:12:42 +0200 Subject: [PATCH] fixes --- backend/models/index.js | 4 ++-- backend/services/clubService.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/models/index.js b/backend/models/index.js index 2fe5a76..7130edf 100644 --- a/backend/models/index.js +++ b/backend/models/index.js @@ -85,8 +85,8 @@ Season.hasMany(Match, { foreignKey: 'seasonId', as: 'matches' }); Match.belongsTo(Location, { foreignKey: 'locationId', as: 'location' }); Location.hasMany(Match, { foreignKey: 'locationId', as: 'matches' }); -User.belongsToMany(Club, { through: UserClub, foreignKey: 'userId', otherKey: 'clubId' }); -Club.belongsToMany(User, { through: UserClub, foreignKey: 'clubId', otherKey: 'userId' }); +User.belongsToMany(Club, { through: UserClub, foreignKey: 'userId' }); +Club.belongsToMany(User, { through: UserClub, foreignKey: 'clubId' }); export { User, diff --git a/backend/services/clubService.js b/backend/services/clubService.js index b6604a7..7eb6c8e 100644 --- a/backend/services/clubService.js +++ b/backend/services/clubService.js @@ -104,7 +104,6 @@ class ClubService { include: [ { model: User, - as: 'userClub', } ] });