chore: fix all Typescript warnings (#8618)
* [CAL-1517] fix all Typescript warnings * solve conflicts * Update stripeCheckoutSession.handler.ts Parse is a guard, so even though the variable is unused the parse itself is needed. * Update ToolbarPlugin.tsx Don't change dependency tree --------- Co-authored-by: gitstart-calcom <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
106 files changed
+425
-319
No files matched your search
@@ -57,7 +57,7 @@ export const getConnectedCalendars = async (
|
||||
}
|
||||
const cals = await calendar.listCalendars();
|
||||
const calendars = sortBy(
|
||||
cals.map((cal) => {
|
||||
cals.map((cal: IntegrationCalendar) => {
|
||||
if (cal.externalId === destinationCalendarExternalId) destinationCalendar = cal;
|
||||
return {
|
||||
...cal,
|
||||
@@ -164,7 +164,7 @@ export const getCachedResults = async (
|
||||
"eventBusyDatesEnd"
|
||||
);
|
||||
|
||||
return eventBusyDates.map((a) => ({ ...a, source: `${appId}` }));
|
||||
return eventBusyDates.map((a: object) => ({ ...a, source: `${appId}` }));
|
||||
});
|
||||
const awaitedResults = await Promise.all(results);
|
||||
performance.mark("getBusyCalendarTimesEnd");
|
||||
@@ -173,7 +173,8 @@ export const getCachedResults = async (
|
||||
"getBusyCalendarTimesStart",
|
||||
"getBusyCalendarTimesEnd"
|
||||
);
|
||||
return awaitedResults;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return awaitedResults as any;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -273,7 +274,7 @@ export const createEvent = async (
|
||||
|
||||
// TODO: Surface success/error messages coming from apps to improve end user visibility
|
||||
const creationResult = calendar
|
||||
? await calendar.createEvent(calEvent).catch(async (error) => {
|
||||
? await calendar.createEvent(calEvent).catch(async (error: { code: number; calError: string }) => {
|
||||
success = false;
|
||||
/**
|
||||
* There is a time when selectedCalendar externalId doesn't match witch certain credential
|
||||
@@ -321,15 +322,15 @@ export const updateEvent = async (
|
||||
if (bookingRefUid === "") {
|
||||
log.error("updateEvent failed", "bookingRefUid is empty", calEvent, credential);
|
||||
}
|
||||
const updatedResult =
|
||||
const updatedResult: NewCalendarEventType | NewCalendarEventType[] | undefined =
|
||||
calendar && bookingRefUid
|
||||
? await calendar
|
||||
.updateEvent(bookingRefUid, calEvent, externalCalendarId)
|
||||
.then((event) => {
|
||||
.then((event: NewCalendarEventType | NewCalendarEventType[]) => {
|
||||
success = true;
|
||||
return event;
|
||||
})
|
||||
.catch(async (e) => {
|
||||
.catch(async (e: { calError: string }) => {
|
||||
// @TODO: This code will be off till we can investigate an error with it
|
||||
// @see https://github.com/calcom/cal.com/issues/3949
|
||||
// await sendBrokenIntegrationEmail(calEvent, "calendar");
|
||||
|
||||
Reference in new issue
Block a user