버그 수정
This commit is contained in:
@@ -32,6 +32,7 @@ exports.getAllEvents = async (req, res) => {
|
||||
where: {
|
||||
status: { [Op.ne]: '취소' }
|
||||
},
|
||||
required: false,
|
||||
include: [{
|
||||
model: Member,
|
||||
attributes: ['id', 'name', 'memberType', 'gender']
|
||||
@@ -83,6 +84,7 @@ exports.getEventById = async (req, res) => {
|
||||
where: {
|
||||
status: { [Op.ne]: '취소' }
|
||||
},
|
||||
required: false,
|
||||
include: [{
|
||||
model: Member,
|
||||
attributes: ['id', 'name']
|
||||
@@ -145,7 +147,7 @@ exports.createEvent = async (req, res) => {
|
||||
clubId,
|
||||
title,
|
||||
description,
|
||||
startDate: new Date(startDate),
|
||||
startDate: startDate ? startDate : null,
|
||||
endDate: endDateVal,
|
||||
location,
|
||||
maxParticipants: maxParticipants || 0,
|
||||
@@ -220,8 +222,8 @@ exports.updateEvent = async (req, res) => {
|
||||
const updateData = {
|
||||
title,
|
||||
description,
|
||||
startDate: startDate ? new Date(startDate) : event.startDate,
|
||||
endDate: endDate ? new Date(endDate) : null,
|
||||
startDate: startDate ? startDate : event.startDate,
|
||||
endDate: endDate || null,
|
||||
location,
|
||||
maxParticipants: maxParticipants || event.maxParticipants,
|
||||
eventType: eventType || event.eventType,
|
||||
@@ -246,11 +248,16 @@ exports.updateEvent = async (req, res) => {
|
||||
attributes: ['id', 'status'],
|
||||
where: {
|
||||
status: { [Op.ne]: '취소' }
|
||||
}
|
||||
},
|
||||
required: false
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
if (!updatedEvent) {
|
||||
return res.status(404).json({ message: '이벤트를 찾을 수 없습니다.' });
|
||||
}
|
||||
|
||||
res.json({
|
||||
message: '이벤트가 수정되었습니다.',
|
||||
event: {
|
||||
|
||||
Reference in New Issue
Block a user