Skip to content

Commit

Permalink
Fix the hard delete feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
zicla committed Jan 2, 2021
1 parent 3752d42 commit 13b6d7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/rest/matter_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type MatterController struct {
BaseController
matterDao *MatterDao
matterService *MatterService
preferenceService *PreferenceService
downloadTokenDao *DownloadTokenDao
imageCacheDao *ImageCacheDao
shareDao *ShareDao
Expand Down
9 changes: 8 additions & 1 deletion code/rest/matter_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,14 @@ func (this *MatterService) AtomicSoftDelete(request *http.Request, matter *Matte
this.userService.MatterLock(matter.UserUuid)
defer this.userService.MatterUnlock(matter.UserUuid)

this.SoftDelete(request, matter, user)
//if disabled the recycle feature. then we hard delete.
preference := this.preferenceService.Fetch()
if preference.DeletedKeepDays == 0 {
this.Delete(request, matter, user)
} else {
this.SoftDelete(request, matter, user)
}

}

//atomic recovery delete files
Expand Down

0 comments on commit 13b6d7f

Please sign in to comment.