2
0

🐛 Incorrect Jump block duplication on typebot import

Closes #379
This commit is contained in:
Baptiste Arnaud
2023-03-10 10:31:38 +01:00
parent 15c1432c32
commit 26c80f064f

View File

@ -7,6 +7,7 @@ import {
LogicBlockType,
Typebot,
} from 'models'
import { JumpBlock } from 'models/features/blocks/logic/jump'
import { blockHasItems, isDefined, isWebhookBlock, sendRequest } from 'utils'
export const importTypebotQuery = async (typebot: Typebot, userPlan: Plan) => {
@ -83,6 +84,14 @@ const duplicateTypebot = (
groupId: groupIdsMapping.get(s.options.groupId as string),
},
}
if (s.type === LogicBlockType.JUMP)
return {
...s,
options: {
...s.options,
groupId: groupIdsMapping.get(s.options.groupId as string),
} satisfies JumpBlock['options'],
}
if (blockHasItems(s))
return {
...s,