mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Delete related notifications on issue deletion too (#18953)
* use .Decr for issue comment counting * Remove notification on issue removal
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							45f8d97131
						
					
				
				
					commit
					04fcf23ea3
				
			@@ -2124,6 +2124,7 @@ func deleteIssue(ctx context.Context, issue *Issue) error {
 | 
			
		||||
		&IssueDependency{},
 | 
			
		||||
		&IssueAssignees{},
 | 
			
		||||
		&IssueUser{},
 | 
			
		||||
		&Notification{},
 | 
			
		||||
		&Reaction{},
 | 
			
		||||
		&IssueWatch{},
 | 
			
		||||
		&Stopwatch{},
 | 
			
		||||
 
 | 
			
		||||
@@ -1163,7 +1163,7 @@ func deleteComment(e db.Engine, comment *Comment) error {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if comment.Type == CommentTypeComment {
 | 
			
		||||
		if _, err := e.Exec("UPDATE `issue` SET num_comments = num_comments - 1 WHERE id = ?", comment.IssueID); err != nil {
 | 
			
		||||
		if _, err := e.ID(comment.IssueID).Decr("num_comments").Update(new(Issue)); err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user