diff --git a/packages/app-store/hubspot-revert/api/add.ts b/packages/app-store/hubspot-revert/api/add.ts index 1f09b3cfb3ad5a..74cd05900c39c1 100644 --- a/packages/app-store/hubspot-revert/api/add.ts +++ b/packages/app-store/hubspot-revert/api/add.ts @@ -37,7 +37,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) res.status(200).json({ url: `https://app.hubspot.com/oauth/authorize?client_id=${ appKeys.client_id - }&redirect_uri=http://localhost:3010/oauth-callback/hubspot&state={%22tenantId%22:%22${tenantId}%22,%22revertPublicToken%22:%22${ + }&redirect_uri=https://app.revert.dev/oauth-callback/hubspot&state={%22tenantId%22:%22${tenantId}%22,%22revertPublicToken%22:%22${ process.env.REVERT_PUBLIC_TOKEN }%22}&scope=${scopes.join("%20")}`, newTab: true, diff --git a/packages/app-store/salesforce-revert/api/add.ts b/packages/app-store/salesforce-revert/api/add.ts index 28fb71d00272b7..916684a07e5b1b 100644 --- a/packages/app-store/salesforce-revert/api/add.ts +++ b/packages/app-store/salesforce-revert/api/add.ts @@ -35,7 +35,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) const queryParams = { response_type: "code", client_id: consumer_key, - redirect_uri: `https://a3f9-103-183-24-51.ngrok-free.app/oauth-callback/sfdc`, + redirect_uri: `https://app.revert.dev/oauth-callback/sfdc`, state: `{%22tenantId%22:%22${tenantId}%22,%22revertPublicToken%22:%22${process.env.REVERT_PUBLIC_TOKEN}%22}`, }; diff --git a/packages/app-store/zohocrm-revert/api/add.ts b/packages/app-store/zohocrm-revert/api/add.ts index dfabcbfc219e77..86598eeec61fac 100644 --- a/packages/app-store/zohocrm-revert/api/add.ts +++ b/packages/app-store/zohocrm-revert/api/add.ts @@ -32,19 +32,14 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) }); const tenantId = teamId ? teamId : userId; // @TODO check scopes before deployment - const scopes = [ - "ZohoCRM.modules.ALL", - "ZohoCRM.settings.ALL", - "ZohoCRM.users.ALL", - "AaaServer.profile.READ", - ]; + const scopes = ["ZohoCRM.modules.ALL", "ZohoCRM.users.READ", "AaaServer.profile.READ"]; const queryParams = { scope: scopes.join(","), client_id, response_type: "code", access_type: "offline", - redirect_uri: "http://localhost:3010/oauth-callback/zohocrm", + redirect_uri: "https://app.revert.dev/oauth-callback/zohocrm", state: `{%22tenantId%22:%22${tenantId}%22,%22revertPublicToken%22:%22${process.env.REVERT_PUBLIC_TOKEN}%22}`, }; diff --git a/packages/app-store/zohocrm-revert/lib/CalendarService.ts b/packages/app-store/zohocrm-revert/lib/CalendarService.ts index d0c5f090a3c61f..bb399a592a8c64 100644 --- a/packages/app-store/zohocrm-revert/lib/CalendarService.ts +++ b/packages/app-store/zohocrm-revert/lib/CalendarService.ts @@ -163,7 +163,7 @@ export default class ZohoCRMRevertCalendarService implements Calendar { return await fetch(`${this.revertApiUrl}crm/events/${uid}`, requestOptions); }; - private deleteMeeting = async (uid: any) => { + private deleteMeeting = async (uid: string) => { const headers = new Headers(); headers.append("x-revert-api-token", this.revertApiKey); headers.append("x-revert-t-id", this.tenantId); @@ -180,9 +180,10 @@ export default class ZohoCRMRevertCalendarService implements Calendar { const meetingEvent = await (await this.createZohoCRMEvent(event, contacts)).json(); if (meetingEvent && meetingEvent.status === "ok") { this.log.debug("event:creation:ok", { meetingEvent }); + return Promise.resolve({ - uid: meetingEvent.result.id, - id: meetingEvent.result.id, + uid: meetingEvent.result.details.id, + id: meetingEvent.result.details.id, type: appConfig.slug, password: "", url: "", @@ -296,6 +297,7 @@ export default class ZohoCRMRevertCalendarService implements Calendar { ); await this.createContacts(nonExistingContacts); + const meetingEvent = await (await this.updateMeeting(uid, event)).json(); if (meetingEvent && meetingEvent.status === "ok") { this.log.debug("event:updation:ok", { meetingEvent }); @@ -312,7 +314,7 @@ export default class ZohoCRMRevertCalendarService implements Calendar { return Promise.reject("Something went wrong when updating a meeting in ZOHO CRM"); } - async deleteEvent(uid: any): Promise { + async deleteEvent(uid: string): Promise { await this.deleteMeeting(uid); }