-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
chore: Update "@hubspot/api-client" from 6.0.1
to 12.0.1
CAL-[5029]
#18670
base: main
Are you sure you want to change the base?
Conversation
….oauth.tokensApi.create()`
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (01/15/25)1 reviewer was added to this PR based on Keith Williams's automation. "Add foundation team as reviewer" took an action on this PR • (01/15/25)1 reviewer was added to this PR based on Keith Williams's automation. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
@@ -1,4 +1,4 @@ | |||
import * as hubspot from "@hubspot/api-client"; |
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.
Let's import specifically what we need
@@ -38,7 +39,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) | |||
if (!client_id) return res.status(400).json({ message: "HubSpot client id missing." }); | |||
if (!client_secret) return res.status(400).json({ message: "HubSpot client secret missing." }); | |||
|
|||
const hubspotToken: HubspotToken = await hubspotClient.oauth.tokensApi.createToken( | |||
const hubspotToken: HubspotToken = await oauth.tokensApi.create( |
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.
Change in method from .createToken()
to create()
hs_meeting_end_time: new Date(event.endTime).toISOString(), | ||
hs_meeting_outcome: "SCHEDULED", | ||
}, | ||
associations: contacts.reduce((associations, contact) => { |
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.
Instead of making a separate call to associate a meeting with a contact, we can do it in one call. It'll actually throw a type error if we don't.
@@ -227,7 +229,7 @@ export default class HubspotCalendarService implements CRM { | |||
return contacts.map((contact) => { | |||
return { | |||
id: contact.id, | |||
email: contact.properties.email, | |||
email: contact.properties.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.
Emails are required for contacts so not sure why it's throwing a string | null
type here.
6.0.1
to 12.0.1
6.0.1
to 12.0.1
CAL-[5029]
What does this PR do?
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?