mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Code Refactor of IssueWatch related things (#10401)
* refactor * optimize * remove Iretating function LoadWatchUsers do not load Users into IW object and it is used only in api ... so move this logic * remove unessesary * Apply suggestions from code review Thx Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * make Tests more robust * fix rebase * restart CI * CI no dont hit sqlites deadlock Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
This commit is contained in:
		@@ -190,9 +190,14 @@ func GetIssueSubscribers(ctx *context.APIContext) {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	users, err := iwl.LoadWatchUsers()
 | 
			
		||||
	var userIDs = make([]int64, 0, len(iwl))
 | 
			
		||||
	for _, iw := range iwl {
 | 
			
		||||
		userIDs = append(userIDs, iw.UserID)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	users, err := models.GetUsersByIDs(userIDs)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		ctx.Error(http.StatusInternalServerError, "LoadWatchUsers", err)
 | 
			
		||||
		ctx.Error(http.StatusInternalServerError, "GetUsersByIDs", err)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user