-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: RR Skip get contact owner username server side #16336
Conversation
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (08/23/24)1 reviewer was added to this PR based on Keith Williams's automation. |
rescheduleUid, | ||
duration: queryDuration, | ||
isInstantMeeting: queryIsInstantMeeting, | ||
email, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read the attendee's email server side from the URL query.
@@ -75,6 +82,28 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) => | |||
fromRedirectOfNonOrgLink: context.query.orgRedirection === "true", | |||
}); | |||
|
|||
const roundRobinUsernamePool = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm picturing in the future there might be use cases where we only want a subset of round robin users for users to book. Ex. based on a specific attribute? @sean-brydon
const crmContactOwner = await getCRMContactOwnerForRRLeadSkip(email, eventData.id); | ||
|
||
if (crmContactOwner) { | ||
const ownerUsername = await prisma.user.findUnique({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Salesforce only the email is stored and the public event endpoint doesn't return emails. For privacy I didn't want to add the users emails to the public endpoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Abstracted from slots/util.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to pass the organizer email when creating new contacts so they belong to the organizer in the CRM.
@@ -201,6 +198,7 @@ export async function getEventType( | |||
}, | |||
}, | |||
hosts: { | |||
...(roundRobinUsernamePool ? { where: { user: { username: { in: roundRobinUsernamePool } } } } : {}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If roundRobinUsernamePool
is passed then when fetching the event type we should also only fetch the hosts that belong in that pool of usernames. This way we don't need to fetch the availability of all the hosts.
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joeauyeung type checks are failing
Closing in favour of a simpler solution in #16367 |
What does this PR do?
Previously we would rely on the
bookingForm
stat to get the CRM contact owner's availability if an email was passed in the URL query. This was causing thegetSchedule
hook to double fire on initial page load.This PR aims to get the CRM contact owner server side and pass that use name to
getSchedule
as a prop so it only has to fetch that single user's availability.https://www.loom.com/share/29ae904eceed4aa5aced449a639d64a1?sid=3cad71bc-1def-49fc-84b2-e06fdf162b40
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
email=...
in the URL query