diff --git a/src/controllers/eventController.js b/src/controllers/eventController.js index 4e50c2ed1..372b7aecb 100644 --- a/src/controllers/eventController.js +++ b/src/controllers/eventController.js @@ -152,11 +152,10 @@ const autoPromoteFromWaitlist = (event) => { while (event.currentAttendees < event.maxAttendees && event.waitlist.length > 0) { const nextEntry = event.waitlist.shift(); - - if (!nextEntry?.userId) continue; - console.log(`Auto-promoting user from waitlist for event ${event._id}`); - event.currentAttendees += 1; - promotedUsers.push(nextEntry.userId); + if (nextEntry?.userId) { + event.currentAttendees += 1; + promotedUsers.push(nextEntry.userId); + } } return promotedUsers; @@ -265,7 +264,6 @@ const joinWaitlist = async (req, res) => { try { const { eventId } = req.params; const { userId } = req.body; - console.log('Join waitlist request received'); if (!userId || !mongoose.Types.ObjectId.isValid(userId)) { return res.status(400).json({ error: 'Invalid userId' }); @@ -294,7 +292,6 @@ const joinWaitlist = async (req, res) => { position, }); } catch (error) { - console.error('JOIN WAITLIST ERROR:', error); res.status(500).json({ error: 'Failed to join waitlist', details: error.message, @@ -304,7 +301,6 @@ const joinWaitlist = async (req, res) => { const sendWaitlistNotification = async (user, event) => { // TODO: Integrate with real notification service (email/queue) - console.log(`Sending waitlist notification for event ${event._id}`); }; const leaveEvent = async (req, res) => {