@@ -1,5 +1,5 @@
|
||||
import { CredentialsType, SmtpCredentialsData } from 'models'
|
||||
import { PrismaClient } from 'db'
|
||||
import { SmtpCredentials } from 'models'
|
||||
import { encrypt } from 'utils/api'
|
||||
import { proWorkspaceId } from 'utils/playwright/databaseSetup'
|
||||
|
||||
@@ -7,7 +7,7 @@ const prisma = new PrismaClient()
|
||||
|
||||
export const createSmtpCredentials = (
|
||||
id: string,
|
||||
smtpData: SmtpCredentialsData
|
||||
smtpData: SmtpCredentials['data']
|
||||
) => {
|
||||
const { encryptedData, iv } = encrypt(smtpData)
|
||||
return prisma.credentials.create({
|
||||
@@ -16,7 +16,7 @@ export const createSmtpCredentials = (
|
||||
data: encryptedData,
|
||||
iv,
|
||||
name: smtpData.from.email as string,
|
||||
type: CredentialsType.SMTP,
|
||||
type: 'smtp',
|
||||
workspaceId: proWorkspaceId,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user