Skip to content

Commit 7104dbd

Browse files
committed
Type fixes
1 parent a24c8cc commit 7104dbd

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

apps/web/lib/__tests__/getTeamMemberEmailFromCrm.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ function mockBookingFormHandler({
4545
vi.mocked(bookingFormHandlers.salesforce).mockImplementation(
4646
(_bookerEmail, _attributeRoutingConfig, _eventTypeId) => {
4747
if (_bookerEmail === bookerEmail) {
48-
return Promise.resolve({ email: teamMemberEmail, recordType: null });
48+
return Promise.resolve({ email: teamMemberEmail, recordType: null, recordId: null });
4949
}
50-
return Promise.resolve({ email: null, recordType: null });
50+
return Promise.resolve({ email: null, recordType: null, recordId: null });
5151
}
5252
);
5353
}

packages/app-store/routing-forms/appBookingFormHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type AppBookingFormHandler = (
55
attendeeEmail: string,
66
attributeRoutingConfig: AttributeRoutingConfig,
77
eventTypeId: number
8-
) => Promise<{ email: string | null; recordType: string | null }>;
8+
) => Promise<{ email: string | null; recordType: string | null; recordId: string | null }>;
99

1010
const appBookingFormHandler: Record<string, AppBookingFormHandler> = {
1111
salesforce: routingFormBookingFormHandler,

packages/lib/server/getTeamMemberEmailFromCrm.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ async function getTeamMemberEmailUsingRoutingFormHandler({
164164
attributeRoutingConfig: AttributeRoutingConfig | null;
165165
crmAppSlug: string;
166166
}) {
167-
const nullReturnValue = { email: null, skipContactOwner: false, recordType: "" };
167+
const nullReturnValue = { email: null, skipContactOwner: false, recordType: "", recordId: "" };
168168

169169
if (!attributeRoutingConfig) return nullReturnValue;
170170

@@ -176,7 +176,11 @@ async function getTeamMemberEmailUsingRoutingFormHandler({
176176
const appHandler = appBookingFormHandler[crmAppSlug];
177177
if (!appHandler) return nullReturnValue;
178178

179-
const { email: userEmail, recordType } = await appHandler(bookerEmail, attributeRoutingConfig, eventTypeId);
179+
const {
180+
email: userEmail,
181+
recordType,
182+
recordId,
183+
} = await appHandler(bookerEmail, attributeRoutingConfig, eventTypeId);
180184

181185
if (!userEmail) return nullReturnValue;
182186

@@ -185,7 +189,7 @@ async function getTeamMemberEmailUsingRoutingFormHandler({
185189

186190
if (!userQuery) return nullReturnValue;
187191

188-
return { ...nullReturnValue, email: userEmail, recordType };
192+
return { ...nullReturnValue, email: userEmail, recordType, recordId };
189193
}
190194

191195
async function getTeamMemberEmailForResponseOrContact({

0 commit comments

Comments
 (0)