mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	#2052 Ability to batch delete system notices
This commit is contained in:
		| @@ -61,3 +61,13 @@ func DeleteNotice(id int64) error { | ||||
| 	_, err := x.Id(id).Delete(new(Notice)) | ||||
| 	return err | ||||
| } | ||||
|  | ||||
| // DeleteNotices deletes all notices with ID from start to end (inclusive). | ||||
| func DeleteNotices(start, end int64) error { | ||||
| 	sess := x.Where("id >= ?", start) | ||||
| 	if end > 0 { | ||||
| 		sess.And("id <= ?", end) | ||||
| 	} | ||||
| 	_, err := sess.Delete(new(Notice)) | ||||
| 	return err | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user