fix(share): remove share when user delete (#1493)

This commit is contained in:
ILoveScratch
2025-10-19 22:48:21 +08:00
committed by GitHub
parent 623a12050e
commit 15f276537c
4 changed files with 13 additions and 1 deletions

View File

@@ -60,3 +60,7 @@ func DeleteSharingById(id string) error {
s := model.SharingDB{ID: id}
return errors.WithStack(db.Where(s).Delete(&s).Error)
}
func DeleteSharingsByCreatorId(creatorId uint) error {
return errors.WithStack(db.Where("creator_id = ?", creatorId).Delete(&model.SharingDB{}).Error)
}