Fix team members API endpoint pagination (#24754)
Now it's 1-based instead of 0-based - Fixes #24747 ### Before  ### After  ## ⚠️ BREAKING ⚠️ Previous API consumers may have relied on the 0-based pagination of this endpoint. The page numbering now starts at 1, as documented. Signed-off-by: Yarden Shoham <git@yardenshoham.com>
This commit is contained in:
		
					parent
					
						
							
								584c0789fa
							
						
					
				
			
			
				commit
				
					
						0a3c4d4a59
					
				
			
		
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -63,8 +63,8 @@ func GetTeamMembers(ctx context.Context, opts *SearchMembersOptions) ([]*user_mo
 | 
			
		|||
				Where(builder.Eq{"team_id": opts.TeamID}),
 | 
			
		||||
		)
 | 
			
		||||
	}
 | 
			
		||||
	if opts.PageSize > 0 && opts.Page > -1 {
 | 
			
		||||
		sess = sess.Limit(opts.PageSize, opts.Page*opts.PageSize)
 | 
			
		||||
	if opts.PageSize > 0 && opts.Page > 0 {
 | 
			
		||||
		sess = sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize)
 | 
			
		||||
	}
 | 
			
		||||
	if err := sess.OrderBy("full_name, name").Find(&members); err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue