Skip to content

Commit

Permalink
update check answer
Browse files Browse the repository at this point in the history
  • Loading branch information
khanh1902 committed Jun 29, 2024
1 parent 93efea4 commit 0fa8c06
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions actions/Prompting.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,24 +180,19 @@ class Prompting extends ComponentDialog {
});
}

const answer = {
name: 'answer',
value: userIntent.intent,
type: 'string',
filled: true,
};

if (conversationData.variables.find((d) => d.name === 'answer')) {
conversationData.variables = conversationData.variables.map((d) =>
d.name === 'answer'
? {
name: 'answer',
value: userIntent.intent,
type: 'string',
filled: true,
}
: d
d.name === 'answer' ? answer : d
);
} else
conversationData.variables.push({
name: 'answer',
value: userIntent.intent,
type: 'string',
filled: true,
});
conversationData.variables.push(answer);

return await step.endDialog({ checkAction: true });
}
Expand Down

0 comments on commit 0fa8c06

Please sign in to comment.