Bettertyping (#10725)

To get better at catching errors on providers
(It will ease also my coming PR to send microsoft messages using
workflow)
This commit is contained in:
Guillim
2025-03-07 14:11:56 +01:00
committed by GitHub
parent 4be75fb7da
commit 4bdcf77028
12 changed files with 48 additions and 28 deletions

View File

@ -1,5 +1,7 @@
import { Injectable } from '@nestjs/common';
import { ConnectedAccountProvider } from 'twenty-shared';
import { GoogleCalendarGetEventsService } from 'src/modules/calendar/calendar-event-import-manager/drivers/google-calendar/services/google-calendar-get-events.service';
import { MicrosoftCalendarGetEventsService } from 'src/modules/calendar/calendar-event-import-manager/drivers/microsoft-calendar/services/microsoft-calendar-get-events.service';
import {
@ -31,12 +33,12 @@ export class CalendarGetCalendarEventsService {
syncCursor?: string,
): Promise<GetCalendarEventsResponse> {
switch (connectedAccount.provider) {
case 'google':
case ConnectedAccountProvider.GOOGLE:
return this.googleCalendarGetEventsService.getCalendarEvents(
connectedAccount,
syncCursor,
);
case 'microsoft':
case ConnectedAccountProvider.MICROSOFT:
return this.microsoftCalendarGetEventsService.getCalendarEvents(
connectedAccount,
syncCursor,