fix: update conversation fixtures + service

This commit is contained in:
yassinedorbozgithub 2025-01-15 08:34:59 +01:00
parent b574295d8c
commit 2a48974336
2 changed files with 4 additions and 4 deletions

View File

@ -71,8 +71,6 @@ export class ConversationService extends BaseService<
const msgType = event.getMessageType(); const msgType = event.getMessageType();
const profile = event.getSender(); const profile = event.getSender();
if (!convo.context) throw new Error('Missing conversation context');
// Capture channel specific context data // Capture channel specific context data
convo.context.channel = event.getHandler().getName(); convo.context.channel = event.getHandler().getName();
convo.context.text = event.getText(); convo.context.text = event.getText();

View File

@ -142,8 +142,10 @@ export const installConversationTypeFixtures = async () => {
conversationFixtures.map((conversationFixture) => ({ conversationFixtures.map((conversationFixture) => ({
...conversationFixture, ...conversationFixture,
sender: subscribers[parseInt(conversationFixture.sender)].id, sender: subscribers[parseInt(conversationFixture.sender)].id,
current: blocks[parseInt(conversationFixture.current)].id, current: conversationFixture?.current
next: conversationFixture.next.map((n) => blocks[parseInt(n)].id), ? blocks[parseInt(conversationFixture.current)]?.id
: undefined,
next: conversationFixture.next?.map((n) => blocks[parseInt(n)].id),
})), })),
); );
}; };