Skip to content

Commit

Permalink
Fixing following seminars bug
Browse files Browse the repository at this point in the history
  • Loading branch information
alliyya committed Nov 27, 2018
1 parent f9ff5da commit ade3341
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions api/src/mutations/seminar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ade3341

Please sign in to comment.