Skip to content

Commit

Permalink
🐛 (webhook) Fix getResultSample when linked typebot not found
Browse files Browse the repository at this point in the history
Closes #364
  • Loading branch information
baptisteArno committed Mar 8, 2023
1 parent 83ae81c commit 167d366
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ export const parseResultExample =

const extractLinkedInputBlocks =
(
typebot: Pick<Typebot | PublicTypebot, 'groups' | 'variables' | 'edges'>,
typebot:
| Pick<Typebot | PublicTypebot, 'groups' | 'variables' | 'edges'>
| undefined,
linkedTypebots: (Typebot | PublicTypebot)[]
) =>
async (
currentGroupId?: string,
direction: 'backward' | 'forward' = 'backward'
): Promise<InputBlock[]> => {
if (!typebot) return []
const previousLinkedTypebotBlocks = walkEdgesAndExtract(
'linkedBot',
direction,
Expand All @@ -63,7 +66,7 @@ const extractLinkedInputBlocks =
'typebotId' in t
? t.typebotId === linkedBot.options.typebotId
: t.id === linkedBot.options.typebotId
) as Typebot | PublicTypebot,
),
linkedTypebots
)(linkedBot.options.groupId, 'forward')
)
Expand Down

0 comments on commit 167d366

Please sign in to comment.