Skip to content

Commit

Permalink
fix(kb.gbapp): Apostrophes correctly processed now.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Apr 27, 2021
1 parent 568c781 commit da8ee93
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/kb.gbapp/services/KBService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export class KBService implements IGBKBService {

public async getAnswerByText(instanceId: number, text: string): Promise<any> {
text = text.trim();

const service = new CSService();
let question = await service.getQuestionFromAlternateText(instanceId, text);

Expand All @@ -199,6 +200,14 @@ export class KBService implements IGBKBService {
}
});
}
if (!question) {
question = await GuaribasQuestion.findOne({
where: {
instanceId: instanceId,
content: { [Op.eq]: `${text}` }
}
});
}

if (question !== null) {
const answer = await GuaribasAnswer.findOne({
Expand Down Expand Up @@ -470,7 +479,7 @@ export class KBService implements IGBKBService {
subject2: subject2,
subject3: subject3,
subject4: subject4,
content: question.replace(/['"]+/g, ''),
content: question.replace(/["]+/g, ''),
instanceId: instanceId,
skipIndex: (question.charAt(0) === "\""),
packageId: packageId
Expand Down

0 comments on commit da8ee93

Please sign in to comment.