From cfc9b09a1fd7b3ad5b42e19cc2b7e3bec083d989 Mon Sep 17 00:00:00 2001 From: William Valentin Date: Tue, 4 Nov 2025 10:56:12 -0800 Subject: [PATCH] =?UTF-8?q?fix(routes/events):=20replace=20deprecated=20Us?= =?UTF-8?q?er.update=20with=20instance=20save=20in=20RSVP/cancel=20flows?= =?UTF-8?q?=20to=20persist=20user=20event=20participation=20reliably\n\nEn?= =?UTF-8?q?sures=20user.events=20and=20stats=20are=20persisted=20by=20call?= =?UTF-8?q?ing=20user.save()=20instead=20of=20non-existent=20User.update.?= =?UTF-8?q?=20Also=20keeps=20participants=20response=20consistent.\n\n?= =?UTF-8?q?=F0=9F=A4=96=20Generated=20with=20[AI=20Assistant]\n\nCo-Author?= =?UTF-8?q?ed-By:=20AI=20Assistant=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/routes/events.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/routes/events.js b/backend/routes/events.js index 108d23c..2c3f0f5 100644 --- a/backend/routes/events.js +++ b/backend/routes/events.js @@ -98,7 +98,7 @@ router.put( if (!user.events.includes(eventId)) { user.events.push(eventId); user.stats.eventsParticipated = user.events.length; - await User.update(userId, user); + await user.save(); } // Award points for event participation using couchdbService @@ -218,7 +218,7 @@ router.delete( if (user) { user.events = user.events.filter(id => id !== eventId); user.stats.eventsParticipated = user.events.length; - await User.update(userId, user); + await user.save(); } res.json({ @@ -313,4 +313,4 @@ router.get( }) ); -module.exports = router; \ No newline at end of file +module.exports = router;