fix(kb.gbapp): Apostrophes correctly processed now.
This commit is contained in:
parent
568c781d1d
commit
da8ee93ba7
1 changed files with 10 additions and 1 deletions
|
@ -188,6 +188,7 @@ export class KBService implements IGBKBService {
|
||||||
|
|
||||||
public async getAnswerByText(instanceId: number, text: string): Promise<any> {
|
public async getAnswerByText(instanceId: number, text: string): Promise<any> {
|
||||||
text = text.trim();
|
text = text.trim();
|
||||||
|
|
||||||
const service = new CSService();
|
const service = new CSService();
|
||||||
let question = await service.getQuestionFromAlternateText(instanceId, text);
|
let question = await service.getQuestionFromAlternateText(instanceId, text);
|
||||||
|
|
||||||
|
@ -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) {
|
if (question !== null) {
|
||||||
const answer = await GuaribasAnswer.findOne({
|
const answer = await GuaribasAnswer.findOne({
|
||||||
|
@ -470,7 +479,7 @@ export class KBService implements IGBKBService {
|
||||||
subject2: subject2,
|
subject2: subject2,
|
||||||
subject3: subject3,
|
subject3: subject3,
|
||||||
subject4: subject4,
|
subject4: subject4,
|
||||||
content: question.replace(/['"]+/g, ''),
|
content: question.replace(/["]+/g, ''),
|
||||||
instanceId: instanceId,
|
instanceId: instanceId,
|
||||||
skipIndex: (question.charAt(0) === "\""),
|
skipIndex: (question.charAt(0) === "\""),
|
||||||
packageId: packageId
|
packageId: packageId
|
||||||
|
|
Loading…
Add table
Reference in a new issue