fix: Set teamMemberEmail server side for CRM RR Skip (#16367)
Co-authored-by: Keith Williams <[email protected]> Co-authored-by: zomars <[email protected]>
This commit is contained in:
17 files changed
+140
-114
No files matched your search
@@ -39,7 +39,7 @@ export default class CrmManager {
|
||||
const contactsToCreate = event.attendees.filter(
|
||||
(attendee) => !contacts.some((contact) => contact.email === attendee.email)
|
||||
);
|
||||
const createdContacts = await this.createContacts(contactsToCreate);
|
||||
const createdContacts = await this.createContacts(contactsToCreate, event.organizer?.email);
|
||||
contacts = contacts.concat(createdContacts);
|
||||
return await crmService?.createEvent(event, contacts);
|
||||
}
|
||||
@@ -60,9 +60,9 @@ export default class CrmManager {
|
||||
return contacts;
|
||||
}
|
||||
|
||||
public async createContacts(contactsToCreate: ContactCreateInput[]) {
|
||||
public async createContacts(contactsToCreate: ContactCreateInput[], organizerEmail?: string) {
|
||||
const crmService = await this.getCrmService(this.credential);
|
||||
const createdContacts = (await crmService?.createContacts(contactsToCreate)) || [];
|
||||
const createdContacts = (await crmService?.createContacts(contactsToCreate, organizerEmail)) || [];
|
||||
return createdContacts;
|
||||
}
|
||||
}
|
||||
@@ -839,13 +839,14 @@ const _getOutOfOfficeDays = async ({
|
||||
|
||||
type GetUserAvailabilityQuery = Parameters<typeof getUserAvailability>[0];
|
||||
type GetUserAvailabilityInitialData = NonNullable<Parameters<typeof getUserAvailability>[1]>;
|
||||
export type GetAvailabilityUser = NonNullable<GetUserAvailabilityInitialData["user"]>;
|
||||
|
||||
const _getUsersAvailability = async ({
|
||||
users,
|
||||
query,
|
||||
initialData,
|
||||
}: {
|
||||
users: (NonNullable<GetUserAvailabilityInitialData["user"]> & {
|
||||
users: (GetAvailabilityUser & {
|
||||
currentBookings?: GetUserAvailabilityInitialData["currentBookings"];
|
||||
})[];
|
||||
query: Omit<GetUserAvailabilityQuery, "userId" | "username">;
|
||||
|
||||
Reference in new issue
Block a user