✨ (editor) Add unpublish and close typebot options
Introducing more menu items on the "Publised" button in the editor. You can now unpublish a typebot and close it to new responses
This commit is contained in:
23
apps/viewer/playwright/services/databaseActions.ts
Normal file
23
apps/viewer/playwright/services/databaseActions.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { CredentialsType, SmtpCredentialsData } from 'models'
|
||||
import { PrismaClient } from 'db'
|
||||
import { encrypt } from 'utils/api'
|
||||
import { freeWorkspaceId } from 'utils/playwright/databaseSetup'
|
||||
|
||||
const prisma = new PrismaClient()
|
||||
|
||||
export const createSmtpCredentials = (
|
||||
id: string,
|
||||
smtpData: SmtpCredentialsData
|
||||
) => {
|
||||
const { encryptedData, iv } = encrypt(smtpData)
|
||||
return prisma.credentials.create({
|
||||
data: {
|
||||
id,
|
||||
data: encryptedData,
|
||||
iv,
|
||||
name: smtpData.from.email as string,
|
||||
type: CredentialsType.SMTP,
|
||||
workspaceId: freeWorkspaceId,
|
||||
},
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user