feat: Anonymize knowledge source content when marking as finished

This commit is contained in:
n4ze3m 2024-12-14 16:32:01 +05:30
parent 5b87173868
commit ccca2eafd3

View File

@ -145,6 +145,12 @@ export const getKnowledgeById = async (id: string) => {
export const updateKnowledgeStatus = async (id: string, status: string) => {
const db = new PageAssistKnowledge()
const knowledge = await db.getById(id)
if(status === "finished") {
knowledge.source = knowledge.source.map(e => ({
...e,
content: undefined,
}))
}
await db.update({
...knowledge,
status