Skip to content

Commit

Permalink
Bug fix on event sign up
Browse files Browse the repository at this point in the history
  • Loading branch information
JiashuHarryHuang committed Oct 10, 2023
1 parent 1a2d4a1 commit fd1f5ef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pages/api/event/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ export default async function handler(
// TODO: Speed this up!
event.volunteers.unshift(user._id);
user.events.unshift(event._id);
if (!user.tags.includes(event.program.tagName)) {
user.tags.unshift(event.program.tagName);
if (event.program != null) {
if (!user.tags.includes(event.program.tagName)) {
user.tags.unshift(event.program.tagName);
}
}
} else if (userIndex === -1 || eventIndex === -1) {
throw new Error('Inconsistency between collections!');
Expand Down

1 comment on commit fd1f5ef

@vercel
Copy link

@vercel vercel bot commented on fd1f5ef Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

bookem-user – ./

bookem-user-bookem.vercel.app
bookem-user-git-main-bookem.vercel.app
bookem-user.vercel.app

Please sign in to comment.