클럽 설정 기능
This commit is contained in:
@@ -198,8 +198,7 @@ exports.createClub = async (req, res) => {
|
||||
// 클럽 정보 업데이트
|
||||
exports.updateClub = async (req, res) => {
|
||||
try {
|
||||
const { id, name, location, description, contact, ownerEmail, status } = req.body;
|
||||
const clubId = id || req.params.id;
|
||||
const { clubId, name, location, description, contact, ownerEmail, status, femaleHandicap } = req.body;
|
||||
const club = await Club.findByPk(clubId);
|
||||
|
||||
if (!club) {
|
||||
@@ -226,6 +225,7 @@ exports.updateClub = async (req, res) => {
|
||||
description: description !== undefined ? description : club.description,
|
||||
contact: contact !== undefined ? contact : club.contact,
|
||||
status: status || club.status,
|
||||
femaleHandicap: femaleHandicap || club.femaleHandicap,
|
||||
ownerId: newOwnerId
|
||||
});
|
||||
|
||||
@@ -421,7 +421,7 @@ exports.addClubMember = async (req, res) => {
|
||||
// 클럽 회원 정보 수정
|
||||
exports.updateClubMember = async (req, res) => {
|
||||
try {
|
||||
const { clubId, memberId, name, gender, memberType, email, phone, status } = req.body;
|
||||
const { clubId, memberId, name, gender, memberType, email, phone, handicap, status } = req.body;
|
||||
|
||||
if (!clubId || !memberId) {
|
||||
return res.status(400).json({ message: '잘못된 클럽 또는 회원 ID입니다.' });
|
||||
@@ -461,6 +461,7 @@ exports.updateClubMember = async (req, res) => {
|
||||
memberType: memberType || member.memberType,
|
||||
email: email || member.email,
|
||||
phone: phone || member.phone,
|
||||
handicap: handicap || member.handicap,
|
||||
status: status || member.status
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user