mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-11-10 21:32:43 +08:00
Fix: delete dataset also delete the link file entity (#20340)
This commit is contained in:
1 parent
71c3e5c5d7
commit
0a715d16e6
1 file changed
+1
-1
@@ -404,7 +404,7 @@ func (d *DatasetService) deleteDataset(ctx context.Context, tenantID string, kb
|
||||
return fmt.Errorf("delete dataset error for %s", kb.ID)
|
||||
}
|
||||
if len(fileIDs) > 0 {
|
||||
if err := tx.Unscoped().Where("id IN ?", fileIDs).Delete(&entity.File{}).Error; err != nil {
|
||||
if err := tx.Unscoped().Where("id IN ? AND source_type = ?", fileIDs, string(entity.FileSourceKnowledgebase)).Delete(&entity.File{}).Error; err != nil {
|
||||
return fmt.Errorf("delete dataset error for %s", kb.ID)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user