mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Use DEFAULT_PAGING_NUM instead of MAX_RESPONSE_ITEMS in ListOptions (#11831)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							ac2304f7a0
						
					
				
				
					commit
					2b2b3e4c37
				
			@@ -38,7 +38,10 @@ func (opts ListOptions) setEnginePagination(e Engine) Engine {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (opts ListOptions) setDefaultValues() {
 | 
					func (opts ListOptions) setDefaultValues() {
 | 
				
			||||||
	if opts.PageSize <= 0 || opts.PageSize > setting.API.MaxResponseItems {
 | 
						if opts.PageSize <= 0 {
 | 
				
			||||||
 | 
							opts.PageSize = setting.API.DefaultPagingNum
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if opts.PageSize > setting.API.MaxResponseItems {
 | 
				
			||||||
		opts.PageSize = setting.API.MaxResponseItems
 | 
							opts.PageSize = setting.API.MaxResponseItems
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if opts.Page <= 0 {
 | 
						if opts.Page <= 0 {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user