회원등록 수정
This commit is contained in:
@@ -595,6 +595,8 @@ exports.saveEventFileData = async (req, res) => {
|
||||
}
|
||||
// 이벤트에서 최종 클럽ID 확정(추가 안정성)
|
||||
const effectiveClubId = Number(event.clubId);
|
||||
// 클럽 인스턴스 로드 (조인 테이블 조작용)
|
||||
const clubInstance = await Club.findOne({ where: { id: effectiveClubId, status: 'active' }, transaction: t });
|
||||
|
||||
// 1.5 팀 정보 처리 - 참가자 처리 전에 팀 생성
|
||||
// 팀 번호별로 그룹화
|
||||
@@ -681,13 +683,14 @@ exports.saveEventFileData = async (req, res) => {
|
||||
status: 'active'
|
||||
}, { transaction: t });
|
||||
|
||||
// 클럽 회원으로 등록
|
||||
await ClubMember.create({
|
||||
clubId: effectiveClubId,
|
||||
memberId: newMember.id,
|
||||
joinDate: new Date(),
|
||||
status: 'active'
|
||||
}, { transaction: t });
|
||||
// 클럽 회원으로 등록 (조인 테이블을 association으로 처리)
|
||||
if (!clubInstance) {
|
||||
throw new Error('클럽을 찾을 수 없습니다.');
|
||||
}
|
||||
await clubInstance.addMember(newMember, {
|
||||
through: { joinDate: new Date(), status: 'active' },
|
||||
transaction: t,
|
||||
});
|
||||
|
||||
// 팀 ID 가져오기
|
||||
let teamId = null;
|
||||
|
||||
Reference in New Issue
Block a user