fix(analytics.gblib): Improvements in customer feedback.
This commit is contained in:
parent
6343313579
commit
d5f42982f6
2 changed files with 17 additions and 11 deletions
|
@ -58,8 +58,8 @@ export class AnalyticsService {
|
|||
rate: number
|
||||
): Promise<GuaribasConversation> {
|
||||
const options = { where: { } };
|
||||
// TODO: Filter by instanceId: instanceId
|
||||
options.where = { conversationId: conversationId };
|
||||
|
||||
options.where = { conversationId: conversationId, instanceId: instanceId };
|
||||
const item = await GuaribasConversation.findOne(options);
|
||||
item.rate = rate;
|
||||
item.rateDate = new Date();
|
||||
|
|
|
@ -44,6 +44,7 @@ import { CSService } from '../services/CSService';
|
|||
import { Messages } from '../strings';
|
||||
import { SecService } from '../../security.gbapp/services/SecService';
|
||||
import { GBServer } from '../../../src/app';
|
||||
import { AnalyticsService } from '../../analytics.gblib/services/AnalyticsService';
|
||||
|
||||
/**
|
||||
* Dialog for feedback collecting.
|
||||
|
@ -147,6 +148,11 @@ export class FeedbackDialog extends IGBDialog {
|
|||
step.result
|
||||
);
|
||||
|
||||
// Updates values to perform Bot Analytics.
|
||||
|
||||
// const analytics = new AnalyticsService();
|
||||
// analytics.updateConversationRate(min.instance.instanceId, user.conversation, rate);
|
||||
|
||||
const fixedLocale = 'en-US';
|
||||
if (rate > 0.5) {
|
||||
await min.conversationalService.sendText(min, step, Messages[fixedLocale].glad_you_liked);
|
||||
|
|
Loading…
Add table
Reference in a new issue