feat(editor): ✨ Add cc & bcc + Deletable credentials
This commit is contained in:
@ -16,7 +16,7 @@ export const useCredentials = ({
|
||||
)
|
||||
if (error) onError(error)
|
||||
return {
|
||||
credentials: data?.credentials,
|
||||
credentials: data?.credentials ?? [],
|
||||
isLoading: !error && !data,
|
||||
mutate,
|
||||
}
|
||||
@ -33,3 +33,14 @@ export const createCredentials = async (
|
||||
method: 'POST',
|
||||
body: credentials,
|
||||
})
|
||||
|
||||
export const deleteCredentials = async (
|
||||
userId: string,
|
||||
credentialsId: string
|
||||
) =>
|
||||
sendRequest<{
|
||||
credentials: Credentials
|
||||
}>({
|
||||
url: `/api/users/${userId}/credentials/${credentialsId}`,
|
||||
method: 'DELETE',
|
||||
})
|
||||
|
@ -2,7 +2,12 @@ import { sendRequest } from 'utils'
|
||||
import { stringify } from 'qs'
|
||||
import useSWR from 'swr'
|
||||
import { fetcher } from './utils'
|
||||
import { Variable, VariableForTest, WebhookResponse } from 'models'
|
||||
import {
|
||||
SmtpCredentialsData,
|
||||
Variable,
|
||||
VariableForTest,
|
||||
WebhookResponse,
|
||||
} from 'models'
|
||||
|
||||
export const getGoogleSheetsConsentScreenUrl = (
|
||||
redirectUrl: string,
|
||||
@ -123,3 +128,13 @@ export const getDeepKeys = (obj: any): string[] => {
|
||||
}
|
||||
return keys
|
||||
}
|
||||
|
||||
export const testSmtpConfig = (smtpData: SmtpCredentialsData, to: string) =>
|
||||
sendRequest({
|
||||
method: 'POST',
|
||||
url: '/api/integrations/email/test-config',
|
||||
body: {
|
||||
...smtpData,
|
||||
to,
|
||||
},
|
||||
})
|
||||
|
Reference in New Issue
Block a user