결제 수정
This commit is contained in:
@@ -755,7 +755,7 @@ exports.getRecentMeetings = async (req, res) => {
|
||||
// 사용자 클럽 목록 조회
|
||||
exports.getUserClubs = async (req, res) => {
|
||||
try {
|
||||
// 사용자가 속한 클럽 목록 조회 (Member 테이블 조인)
|
||||
const { userId } = req.body;
|
||||
// admin이면 모든 클럽을, 아니면 자신의 클럽만 조회
|
||||
const hasAdminAccess = isAdmin(req.user);
|
||||
|
||||
@@ -768,7 +768,7 @@ exports.getUserClubs = async (req, res) => {
|
||||
queryOptions.include = [{
|
||||
model: Member,
|
||||
where: {
|
||||
userId: req.user.id
|
||||
userId: userId
|
||||
},
|
||||
attributes: ['memberType']
|
||||
}];
|
||||
|
||||
@@ -89,6 +89,9 @@ Club.associate = (models) => {
|
||||
through: models.ClubFeature,
|
||||
foreignKey: 'clubId',
|
||||
});
|
||||
|
||||
// Member와의 관계 추가
|
||||
Club.hasMany(models.Member, { foreignKey: 'clubId' });
|
||||
};
|
||||
|
||||
module.exports = Club;
|
||||
|
||||
Reference in New Issue
Block a user