⚗️ Implement chat API
This commit is contained in:
@ -30,6 +30,7 @@ export const parseNewTypebot = ({
|
||||
| 'icon'
|
||||
| 'isArchived'
|
||||
| 'isClosed'
|
||||
| 'resultsTablePreferences'
|
||||
> => {
|
||||
const startGroupId = cuid()
|
||||
const startBlockId = cuid()
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { duplicateWebhookQueries } from '@/features/blocks/integrations/webhook'
|
||||
import cuid from 'cuid'
|
||||
import { Plan } from 'db'
|
||||
import { Plan, Prisma } from 'db'
|
||||
import {
|
||||
ChoiceInputBlock,
|
||||
ConditionBlock,
|
||||
@ -38,7 +38,10 @@ export const importTypebotQuery = async (typebot: Typebot, userPlan: Plan) => {
|
||||
const duplicateTypebot = (
|
||||
typebot: Typebot,
|
||||
userPlan: Plan
|
||||
): { typebot: Typebot; webhookIdsMapping: Map<string, string> } => {
|
||||
): {
|
||||
typebot: Omit<Prisma.TypebotUncheckedCreateInput, 'id'> & { id: string }
|
||||
webhookIdsMapping: Map<string, string>
|
||||
} => {
|
||||
const groupIdsMapping = generateOldNewIdsMapping(typebot.groups)
|
||||
const edgeIdsMapping = generateOldNewIdsMapping(typebot.edges)
|
||||
const webhookIdsMapping = generateOldNewIdsMapping(
|
||||
@ -119,8 +122,8 @@ const duplicateTypebot = (
|
||||
general: { ...typebot.settings.general, isBrandingEnabled: true },
|
||||
}
|
||||
: typebot.settings,
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
resultsTablePreferences: typebot.resultsTablePreferences ?? undefined,
|
||||
},
|
||||
webhookIdsMapping,
|
||||
|
Reference in New Issue
Block a user