From ade33419780f92c5602663b330bda66629dd3def Mon Sep 17 00:00:00 2001 From: Alliyya Mo Date: Mon, 26 Nov 2018 19:15:04 -0500 Subject: [PATCH] Fixing following seminars bug --- api/src/mutations/seminar.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/api/src/mutations/seminar.js b/api/src/mutations/seminar.js index 047eb26..ce5ac28 100644 --- a/api/src/mutations/seminar.js +++ b/api/src/mutations/seminar.js @@ -194,14 +194,13 @@ async function updateSeminarParticipation( seminarid ); - if (!(await isAttendingEvent(userid, event_id))) { - return new Error("User must be attending event of this seminar"); - } - if (participationType.toUpperCase() == "ATTENDING") { // throws if error user already attending when trying to add to a seminar if (adding) { await alreadyAttendingSeminar(userid, seminarid); + if (!(await isAttendingEvent(userid, event_id))) { + return new Error("User must be attending event of this seminar"); + } } // Checking if user can be added to event or should be added to waitlist if (max_capacity && current_capacity == max_capacity && adding) {