🐛 (webhook) Fix getResultSample when linked typebot not found
Closes #364
This commit is contained in:
@ -39,13 +39,16 @@ export const parseResultExample =
|
|||||||
|
|
||||||
const extractLinkedInputBlocks =
|
const extractLinkedInputBlocks =
|
||||||
(
|
(
|
||||||
typebot: Pick<Typebot | PublicTypebot, 'groups' | 'variables' | 'edges'>,
|
typebot:
|
||||||
|
| Pick<Typebot | PublicTypebot, 'groups' | 'variables' | 'edges'>
|
||||||
|
| undefined,
|
||||||
linkedTypebots: (Typebot | PublicTypebot)[]
|
linkedTypebots: (Typebot | PublicTypebot)[]
|
||||||
) =>
|
) =>
|
||||||
async (
|
async (
|
||||||
currentGroupId?: string,
|
currentGroupId?: string,
|
||||||
direction: 'backward' | 'forward' = 'backward'
|
direction: 'backward' | 'forward' = 'backward'
|
||||||
): Promise<InputBlock[]> => {
|
): Promise<InputBlock[]> => {
|
||||||
|
if (!typebot) return []
|
||||||
const previousLinkedTypebotBlocks = walkEdgesAndExtract(
|
const previousLinkedTypebotBlocks = walkEdgesAndExtract(
|
||||||
'linkedBot',
|
'linkedBot',
|
||||||
direction,
|
direction,
|
||||||
@ -63,7 +66,7 @@ const extractLinkedInputBlocks =
|
|||||||
'typebotId' in t
|
'typebotId' in t
|
||||||
? t.typebotId === linkedBot.options.typebotId
|
? t.typebotId === linkedBot.options.typebotId
|
||||||
: t.id === linkedBot.options.typebotId
|
: t.id === linkedBot.options.typebotId
|
||||||
) as Typebot | PublicTypebot,
|
),
|
||||||
linkedTypebots
|
linkedTypebots
|
||||||
)(linkedBot.options.groupId, 'forward')
|
)(linkedBot.options.groupId, 'forward')
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user