feat: Anonymize knowledge source content when marking as finished
This commit is contained in:
parent
5b87173868
commit
ccca2eafd3
@ -145,6 +145,12 @@ export const getKnowledgeById = async (id: string) => {
|
|||||||
export const updateKnowledgeStatus = async (id: string, status: string) => {
|
export const updateKnowledgeStatus = async (id: string, status: string) => {
|
||||||
const db = new PageAssistKnowledge()
|
const db = new PageAssistKnowledge()
|
||||||
const knowledge = await db.getById(id)
|
const knowledge = await db.getById(id)
|
||||||
|
if(status === "finished") {
|
||||||
|
knowledge.source = knowledge.source.map(e => ({
|
||||||
|
...e,
|
||||||
|
content: undefined,
|
||||||
|
}))
|
||||||
|
}
|
||||||
await db.update({
|
await db.update({
|
||||||
...knowledge,
|
...knowledge,
|
||||||
status
|
status
|
||||||
|
Loading…
x
Reference in New Issue
Block a user