Skip to content

Commit fea093b

Browse files
authored
fix: delete follow info while delete project (YMFE#1691)
1 parent 47ebd8b commit fea093b

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

server/controllers/project.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ class projectController extends baseController {
626626
await interfaceInst.delByProjectId(id);
627627
await interfaceCaseInst.delByProjectId(id);
628628
await interfaceColInst.delByProjectId(id);
629+
await this.followModel.delByProjectId(id);
629630
yapi.emitHook('project_del', id).then();
630631
let result = await this.Model.del(id);
631632
ctx.body = yapi.commons.resReturn(result);

server/models/follow.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ class followModel extends baseModel {
4242
});
4343
}
4444

45+
delByProjectId(projectid){
46+
return this.model.remove({
47+
projectid: projectid
48+
})
49+
}
50+
4551
list(uid) {
4652
return this.model
4753
.find({

0 commit comments

Comments
 (0)