mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
create question missing cache fix
This commit is contained in:
parent
c167dcf5b2
commit
b700bfba77
3 changed files with 7 additions and 4 deletions
|
@ -1061,8 +1061,7 @@ function GetApp(): ModuleType {
|
|||
|
||||
if (!req.body.questions) {
|
||||
res.json({
|
||||
message:
|
||||
'ask something! ?q=[question]&subj=[subject]&data=[question data]. "subj" is optimal for faster result',
|
||||
message: `ask something! { question:'' ,subject:'', location:'' }`,
|
||||
result: [],
|
||||
recievedData: JSON.stringify(req.body),
|
||||
success: false,
|
||||
|
@ -1135,7 +1134,7 @@ function GetApp(): ModuleType {
|
|||
}
|
||||
})
|
||||
|
||||
function getDbIndexesToSearchIn(testUrl, trueIfAlways?) {
|
||||
function getDbIndexesToSearchIn(testUrl: string, trueIfAlways?: boolean) {
|
||||
return testUrl
|
||||
? questionDbs.reduce((acc, qdb, i) => {
|
||||
if (shouldSearchDataFile(qdb, testUrl, trueIfAlways)) {
|
||||
|
|
|
@ -217,6 +217,10 @@ function createQuestion(
|
|||
Q: simplifyQuestion(question),
|
||||
A: answer ? simplifyAnswer(answer) : undefined,
|
||||
data: data,
|
||||
cache: {
|
||||
Q: question ? simplifyString(question).split(' ') : [],
|
||||
A: answer ? simplifyString(answer).split(' ') : [],
|
||||
},
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 7f4163736cc0bfed3259f39f7bc0063ca191da21
|
||||
Subproject commit 6a2c22f24a005ea677e895a51a9f583ffa00265d
|
Loading…
Add table
Add a link
Reference in a new issue