mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
Fix for 1881 sorting for Flowise QnA
This commit is contained in:
@@ -1371,13 +1371,12 @@ export class App {
|
|||||||
}
|
}
|
||||||
templates.push(template)
|
templates.push(template)
|
||||||
})
|
})
|
||||||
const FlowiseDocsQnA = templates.find((tmp) => tmp.name === 'Flowise Docs QnA')
|
const sortedTemplates = templates.sort((a, b) => a.templateName.localeCompare(b.templateName))
|
||||||
const FlowiseDocsQnAIndex = templates.findIndex((tmp) => tmp.name === 'Flowise Docs QnA')
|
const FlowiseDocsQnAIndex = sortedTemplates.findIndex((tmp) => tmp.templateName === 'Flowise Docs QnA');
|
||||||
if (FlowiseDocsQnA && FlowiseDocsQnAIndex > 0) {
|
if (FlowiseDocsQnAIndex > 0) {
|
||||||
templates.splice(FlowiseDocsQnAIndex, 1)
|
sortedTemplates.unshift(sortedTemplates.splice(FlowiseDocsQnAIndex, 1)[0]);
|
||||||
templates.unshift(FlowiseDocsQnA)
|
|
||||||
}
|
}
|
||||||
return res.json(templates.sort((a, b) => a.templateName.localeCompare(b.templateName)))
|
return res.json(sortedTemplates)
|
||||||
})
|
})
|
||||||
|
|
||||||
// ----------------------------------------
|
// ----------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user