From 93580ac4bc5ac182262dd16fa8801a82f2932847 Mon Sep 17 00:00:00 2001 From: Rajiv Sahal Date: Tue, 4 Jun 2024 16:47:33 +0530 Subject: [PATCH] fix: typo in `Gcal` atom prop and outlook service (#15319) * fix typo in onCheckError prop * pass in correct access token --------- Co-authored-by: Rajiv Sahal --- apps/api/v2/src/ee/calendars/services/outlook.service.ts | 2 +- packages/platform/atoms/gcal-connect/GcalConnect.tsx | 6 +++--- packages/platform/atoms/hooks/useGcal.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/api/v2/src/ee/calendars/services/outlook.service.ts b/apps/api/v2/src/ee/calendars/services/outlook.service.ts index b1b2d50f7d..c675526c90 100644 --- a/apps/api/v2/src/ee/calendars/services/outlook.service.ts +++ b/apps/api/v2/src/ee/calendars/services/outlook.service.ts @@ -156,7 +156,7 @@ export class OutlookService implements OAuthCalendarApp { const office365OAuthCredentials = await this.getOAuthCredentials(parsedCode); - const defaultCalendar = await this.getDefaultCalendar(accessToken); + const defaultCalendar = await this.getDefaultCalendar(office365OAuthCredentials.access_token); if (defaultCalendar?.id) { const credential = await this.credentialRepository.createAppCredential( diff --git a/packages/platform/atoms/gcal-connect/GcalConnect.tsx b/packages/platform/atoms/gcal-connect/GcalConnect.tsx index bcde8acaa6..10e7986491 100644 --- a/packages/platform/atoms/gcal-connect/GcalConnect.tsx +++ b/packages/platform/atoms/gcal-connect/GcalConnect.tsx @@ -3,7 +3,7 @@ import type { FC } from "react"; import { Button } from "@calcom/ui"; import { useAtomsContext } from "../hooks/useAtomsContext"; -import type { OnCheckErroType } from "../hooks/useGcal"; +import type { OnCheckErrorType } from "../hooks/useGcal"; import { useGcal } from "../hooks/useGcal"; import { AtomsWrapper } from "../src/components/atoms-wrapper"; import { cn } from "../src/lib/utils"; @@ -12,7 +12,7 @@ interface GcalConnectProps { className?: string; label?: string; alreadyConnectedLabel?: string; - onCheckError?: OnCheckErroType; + onCheckError?: OnCheckErrorType; } /** @@ -32,7 +32,7 @@ interface GcalConnectProps { * @param {string} [label="Connect Google Calendar"] - The label for the connect button. Optional. * @param {string} [alreadyConnectedLabel="Connected Google Calendar"] - The label for the already connected button. Optional. * @param {string} [className] - Additional CSS class name for the button. Optional. - * @param {OnCheckErroType} [onCheckError] - A callback function to handle errors when checking the connection status. Optional. + * @param {OnCheckErrorType} [onCheckError] - A callback function to handle errors when checking the connection status. Optional. * @returns {JSX.Element} The rendered component. */ export const GcalConnect: FC = ({ diff --git a/packages/platform/atoms/hooks/useGcal.ts b/packages/platform/atoms/hooks/useGcal.ts index 3dd936ce30..1c617c9e54 100644 --- a/packages/platform/atoms/hooks/useGcal.ts +++ b/packages/platform/atoms/hooks/useGcal.ts @@ -4,10 +4,10 @@ import type { ApiErrorResponse } from "@calcom/platform-types"; import http from "../lib/http"; -export type OnCheckErroType = (err: ApiErrorResponse) => void; +export type OnCheckErrorType = (err: ApiErrorResponse) => void; export interface useGcalProps { isAuth: boolean; - onCheckError?: OnCheckErroType; + onCheckError?: OnCheckErrorType; } export const useGcal = ({ isAuth, onCheckError }: useGcalProps) => {