diff --git a/controllers/moderator/reports.go b/controllers/moderator/reports.go index d78d54bb..cee63d9d 100644 --- a/controllers/moderator/reports.go +++ b/controllers/moderator/reports.go @@ -1,7 +1,6 @@ package moderatorController import ( - "fmt" "html" "net/http" "strconv" @@ -39,13 +38,16 @@ func TorrentReportListPanel(c *gin.Context) { func TorrentReportDeleteModPanel(c *gin.Context) { id := c.PostForm("id") - fmt.Println(id) - idNum, _ := strconv.ParseUint(id, 10, 64) - _, _, _ = reports.Delete(uint(idNum)) - /* If we need to log report delete activity - if err == nil { - activity.Log(&models.User{}, torrent.Identifier(), "delete", "torrent_report_deleted_by", strconv.Itoa(int(report.ID)), router.GetUser(c).Username) + if c.Request.URL.Query()["all"] != nil { + reports.DeleteAll() + } else { + idNum, _ := strconv.ParseUint(id, 10, 64) + _, _, _ = reports.Delete(uint(idNum)) + /* If we need to log report delete activity + if err == nil { + activity.Log(&models.User{}, torrent.Identifier(), "delete", "torrent_report_deleted_by", strconv.Itoa(int(report.ID)), router.GetUser(c).Username) + } + */ } - */ c.Redirect(http.StatusSeeOther, "/mod/reports?deleted") }