Add guest management functionality to existing bookings#9
Conversation
* feat: ability to add guests via app.cal.com/bookings * fix: some update * fix: minor issue * fix: final update * update * update * add requested changes * fix type error * small update * final update * fix type error * fix location * update calender event --------- Co-authored-by: Somay Chauhan <somaychauhan98@gmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: baa9045af7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const isTeamAdminOrOwner = | ||
| (await isTeamAdmin(user.id, booking.eventType?.teamId ?? 0)) && | ||
| (await isTeamOwner(user.id, booking.eventType?.teamId ?? 0)); |
There was a problem hiding this comment.
Allow team admins or owners to add guests
The permission gate sets isTeamAdminOrOwner using isTeamAdmin && isTeamOwner, which requires a user to be both roles. For team bookings this will block legitimate admins who are not owners (and owners who are not admins) from adding guests, even though they should have the right to manage attendees. This is introduced here and can be fixed by using an OR check or the appropriate existing helper for admin/owner access.
Useful? React with 👍 / 👎.
| try { | ||
| await sendAddGuestsEmails(evt, guests); |
There was a problem hiding this comment.
Avoid sending “new guest” emails to existing attendees
The handler computes uniqueGuests (new, non-blacklisted emails) but passes the original guests array into sendAddGuestsEmails. That email helper treats any address in newGuests as a newly added attendee, so if a caller includes an existing attendee email alongside new ones, the existing attendee will be sent the scheduled/new-attendee email instead of the “guests added” notification. Passing uniqueGuests (or filtering before calling) prevents this misclassification.
Useful? React with 👍 / 👎.
Test 10nn---nReplicated from ai-code-review-evaluation/cal.com-cursor#10