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

@ -14,7 +14,7 @@ import { WorkflowVariablePicker } from '@/workflow/workflow-variables/components
import { useTheme } from '@emotion/react';
import { useEffect, useState } from 'react';
import { useRecoilValue } from 'recoil';
import { isDefined } from 'twenty-shared';
import { ConnectedAccountProvider, isDefined } from 'twenty-shared';
import { IconPlus, useIcons } from 'twenty-ui';
import { JsonValue } from 'type-fest';
import { useDebouncedCallback } from 'use-debounce';
@ -71,7 +71,7 @@ export const WorkflowEditActionFormSendEmail = ({
!isDefined(scopes) ||
!isDefined(scopes.find((scope) => scope === GMAIL_SEND_SCOPE))
) {
await triggerApisOAuth('google', {
await triggerApisOAuth(ConnectedAccountProvider.GOOGLE, {
redirectLocation: redirectUrl,
loginHint: connectedAccount.handle,
});
@ -200,7 +200,7 @@ export const WorkflowEditActionFormSendEmail = ({
options={connectedAccountOptions}
callToActionButton={{
onClick: () =>
triggerApisOAuth('google', {
triggerApisOAuth(ConnectedAccountProvider.GOOGLE, {
redirectLocation: redirectUrl,
}),
Icon: IconPlus,